{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "简介：\n",
    "> Altair: Declarative Visualization in Python  [官网](https://altair-viz.github.io/)\n",
    "\n",
    "声明式python可视化库\n",
    "\n",
    "## 基础绘图\n",
    "更擅长画统计图表，下面的数据全用数据框格式进行实践"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "#!pip install altair vega_datasets #如果还没安装的话，安装altair和数据集\n",
    "import altair as alt\n",
    "import pandas as pd"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "d1=pd.DataFrame({'x':['Mon.','Tue.','Wed.','Thu.','Fri.'],\n",
    "                 'y':[76,37,90,60,50],\n",
    "                 'z':[37,46,53,81,60],\n",
    "                 'h':[3,1,5,4,2],\n",
    "                 'k':['a','a','c','d','c']})"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "#散点图"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 137,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "\n",
       "<div id=\"altair-viz-4a49ca6c3e924c73a2738a0230e7a0e9\"></div>\n",
       "<script type=\"text/javascript\">\n",
       "  (function(spec, embedOpt){\n",
       "    const outputDiv = document.getElementById(\"altair-viz-4a49ca6c3e924c73a2738a0230e7a0e9\");\n",
       "    const paths = {\n",
       "      \"vega\": \"https://cdn.jsdelivr.net/npm//vega@5?noext\",\n",
       "      \"vega-lib\": \"https://cdn.jsdelivr.net/npm//vega-lib?noext\",\n",
       "      \"vega-lite\": \"https://cdn.jsdelivr.net/npm//vega-lite@4.0.2?noext\",\n",
       "      \"vega-embed\": \"https://cdn.jsdelivr.net/npm//vega-embed@6?noext\",\n",
       "    };\n",
       "\n",
       "    function loadScript(lib) {\n",
       "      return new Promise(function(resolve, reject) {\n",
       "        var s = document.createElement('script');\n",
       "        s.src = paths[lib];\n",
       "        s.async = true;\n",
       "        s.onload = () => resolve(paths[lib]);\n",
       "        s.onerror = () => reject(`Error loading script: ${paths[lib]}`);\n",
       "        document.getElementsByTagName(\"head\")[0].appendChild(s);\n",
       "      });\n",
       "    }\n",
       "\n",
       "    function showError(err) {\n",
       "      outputDiv.innerHTML = `<div class=\"error\" style=\"color:red;\">${err}</div>`;\n",
       "      throw err;\n",
       "    }\n",
       "\n",
       "    function displayChart(vegaEmbed) {\n",
       "      vegaEmbed(outputDiv, spec, embedOpt)\n",
       "        .catch(err => showError(`Javascript Error: ${err.message}<br>This usually means there's a typo in your chart specification. See the javascript console for the full traceback.`));\n",
       "    }\n",
       "\n",
       "    if(typeof define === \"function\" && define.amd) {\n",
       "      requirejs.config({paths});\n",
       "      require([\"vega-embed\"], displayChart, err => showError(`Error loading script: ${err.message}`));\n",
       "    } else if (typeof vegaEmbed === \"function\") {\n",
       "      displayChart(vegaEmbed);\n",
       "    } else {\n",
       "      loadScript(\"vega\")\n",
       "        .then(() => loadScript(\"vega-lite\"))\n",
       "        .then(() => loadScript(\"vega-embed\"))\n",
       "        .catch(showError)\n",
       "        .then(() => displayChart(vegaEmbed));\n",
       "    }\n",
       "  })({\"config\": {\"view\": {\"height\": 300, \"width\": 400}, \"mark\": {\"color\": \"#1eafae\"}}, \"data\": {\"name\": \"data-8d5d1ee392d8e452bad0eca3307d86e5\"}, \"mark\": \"point\", \"encoding\": {\"color\": {\"type\": \"nominal\", \"field\": \"k\"}, \"x\": {\"type\": \"nominal\", \"field\": \"x\"}, \"y\": {\"type\": \"quantitative\", \"field\": \"y\"}}, \"height\": 300, \"selection\": {\"selector093\": {\"type\": \"interval\", \"bind\": \"scales\", \"encodings\": [\"x\", \"y\"]}}, \"width\": 400, \"$schema\": \"https://vega.github.io/schema/vega-lite/v4.0.2.json\", \"datasets\": {\"data-8d5d1ee392d8e452bad0eca3307d86e5\": [{\"x\": \"Mon.\", \"y\": 76, \"z\": 37, \"h\": 3, \"k\": \"a\"}, {\"x\": \"Tue.\", \"y\": 37, \"z\": 46, \"h\": 1, \"k\": \"a\"}, {\"x\": \"Wed.\", \"y\": 90, \"z\": 53, \"h\": 5, \"k\": \"c\"}, {\"x\": \"Thu.\", \"y\": 60, \"z\": 81, \"h\": 4, \"k\": \"d\"}, {\"x\": \"Fri.\", \"y\": 50, \"z\": 60, \"h\": 2, \"k\": \"c\"}]}}, {\"mode\": \"vega-lite\"});\n",
       "</script>"
      ],
      "text/plain": [
       "alt.Chart(...)"
      ]
     },
     "execution_count": 137,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "alt.Chart(df,width=400,height=300).mark_point().encode(\n",
    "    x='x',\n",
    "    y='y',\n",
    "    color='k',\n",
    ").interactive()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "根据Chart的参数（通过?alt.Chart()可看）可以了解到，也可以不写alt.Chart().mark_*().encode()而是写alt.Chart(mark='point').encode()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "alt.Chart(df,width=400,height=300,mark='point').encode(\n",
    "    x='x',\n",
    "    y='y',\n",
    "    size='z'\n",
    ")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "alt.Chart(df,width=400,height=300).mark_point(filled=True,color='#1EAFAE',opacity=0.5).encode(\n",
    "    x='x',\n",
    "    y='y',\n",
    "    size='z'\n",
    ")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "#折线图"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {
    "scrolled": false
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "\n",
       "<div id=\"altair-viz-174a102f3cab4106a38206d3edb43ac6\"></div>\n",
       "<script type=\"text/javascript\">\n",
       "  (function(spec, embedOpt){\n",
       "    const outputDiv = document.getElementById(\"altair-viz-174a102f3cab4106a38206d3edb43ac6\");\n",
       "    const paths = {\n",
       "      \"vega\": \"https://cdn.jsdelivr.net/npm//vega@5?noext\",\n",
       "      \"vega-lib\": \"https://cdn.jsdelivr.net/npm//vega-lib?noext\",\n",
       "      \"vega-lite\": \"https://cdn.jsdelivr.net/npm//vega-lite@4.0.2?noext\",\n",
       "      \"vega-embed\": \"https://cdn.jsdelivr.net/npm//vega-embed@6?noext\",\n",
       "    };\n",
       "\n",
       "    function loadScript(lib) {\n",
       "      return new Promise(function(resolve, reject) {\n",
       "        var s = document.createElement('script');\n",
       "        s.src = paths[lib];\n",
       "        s.async = true;\n",
       "        s.onload = () => resolve(paths[lib]);\n",
       "        s.onerror = () => reject(`Error loading script: ${paths[lib]}`);\n",
       "        document.getElementsByTagName(\"head\")[0].appendChild(s);\n",
       "      });\n",
       "    }\n",
       "\n",
       "    function showError(err) {\n",
       "      outputDiv.innerHTML = `<div class=\"error\" style=\"color:red;\">${err}</div>`;\n",
       "      throw err;\n",
       "    }\n",
       "\n",
       "    function displayChart(vegaEmbed) {\n",
       "      vegaEmbed(outputDiv, spec, embedOpt)\n",
       "        .catch(err => showError(`Javascript Error: ${err.message}<br>This usually means there's a typo in your chart specification. See the javascript console for the full traceback.`));\n",
       "    }\n",
       "\n",
       "    if(typeof define === \"function\" && define.amd) {\n",
       "      requirejs.config({paths});\n",
       "      require([\"vega-embed\"], displayChart, err => showError(`Error loading script: ${err.message}`));\n",
       "    } else if (typeof vegaEmbed === \"function\") {\n",
       "      displayChart(vegaEmbed);\n",
       "    } else {\n",
       "      loadScript(\"vega\")\n",
       "        .then(() => loadScript(\"vega-lite\"))\n",
       "        .then(() => loadScript(\"vega-embed\"))\n",
       "        .catch(showError)\n",
       "        .then(() => displayChart(vegaEmbed));\n",
       "    }\n",
       "  })({\"config\": {\"view\": {\"continuousWidth\": 400, \"continuousHeight\": 300}}, \"data\": {\"name\": \"data-8d5d1ee392d8e452bad0eca3307d86e5\"}, \"mark\": {\"type\": \"line\", \"color\": \"#1EAFAE\"}, \"encoding\": {\"x\": {\"type\": \"nominal\", \"field\": \"x\"}, \"y\": {\"type\": \"quantitative\", \"field\": \"y\"}}, \"height\": 300, \"width\": 400, \"$schema\": \"https://vega.github.io/schema/vega-lite/v4.0.2.json\", \"datasets\": {\"data-8d5d1ee392d8e452bad0eca3307d86e5\": [{\"x\": \"Mon.\", \"y\": 76, \"z\": 37, \"h\": 3, \"k\": \"a\"}, {\"x\": \"Tue.\", \"y\": 37, \"z\": 46, \"h\": 1, \"k\": \"a\"}, {\"x\": \"Wed.\", \"y\": 90, \"z\": 53, \"h\": 5, \"k\": \"c\"}, {\"x\": \"Thu.\", \"y\": 60, \"z\": 81, \"h\": 4, \"k\": \"d\"}, {\"x\": \"Fri.\", \"y\": 50, \"z\": 60, \"h\": 2, \"k\": \"c\"}]}}, {\"mode\": \"vega-lite\"});\n",
       "</script>"
      ],
      "text/plain": [
       "alt.Chart(...)"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "alt.Chart(df,width=400,height=300).mark_line(color='#1EAFAE').encode(\n",
    "    x='x',\n",
    "    y='y'\n",
    ")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 138,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "\n",
       "<div id=\"altair-viz-f9042752600a43108fe0ba0881fa6ac9\"></div>\n",
       "<script type=\"text/javascript\">\n",
       "  (function(spec, embedOpt){\n",
       "    const outputDiv = document.getElementById(\"altair-viz-f9042752600a43108fe0ba0881fa6ac9\");\n",
       "    const paths = {\n",
       "      \"vega\": \"https://cdn.jsdelivr.net/npm//vega@5?noext\",\n",
       "      \"vega-lib\": \"https://cdn.jsdelivr.net/npm//vega-lib?noext\",\n",
       "      \"vega-lite\": \"https://cdn.jsdelivr.net/npm//vega-lite@4.0.2?noext\",\n",
       "      \"vega-embed\": \"https://cdn.jsdelivr.net/npm//vega-embed@6?noext\",\n",
       "    };\n",
       "\n",
       "    function loadScript(lib) {\n",
       "      return new Promise(function(resolve, reject) {\n",
       "        var s = document.createElement('script');\n",
       "        s.src = paths[lib];\n",
       "        s.async = true;\n",
       "        s.onload = () => resolve(paths[lib]);\n",
       "        s.onerror = () => reject(`Error loading script: ${paths[lib]}`);\n",
       "        document.getElementsByTagName(\"head\")[0].appendChild(s);\n",
       "      });\n",
       "    }\n",
       "\n",
       "    function showError(err) {\n",
       "      outputDiv.innerHTML = `<div class=\"error\" style=\"color:red;\">${err}</div>`;\n",
       "      throw err;\n",
       "    }\n",
       "\n",
       "    function displayChart(vegaEmbed) {\n",
       "      vegaEmbed(outputDiv, spec, embedOpt)\n",
       "        .catch(err => showError(`Javascript Error: ${err.message}<br>This usually means there's a typo in your chart specification. See the javascript console for the full traceback.`));\n",
       "    }\n",
       "\n",
       "    if(typeof define === \"function\" && define.amd) {\n",
       "      requirejs.config({paths});\n",
       "      require([\"vega-embed\"], displayChart, err => showError(`Error loading script: ${err.message}`));\n",
       "    } else if (typeof vegaEmbed === \"function\") {\n",
       "      displayChart(vegaEmbed);\n",
       "    } else {\n",
       "      loadScript(\"vega\")\n",
       "        .then(() => loadScript(\"vega-lite\"))\n",
       "        .then(() => loadScript(\"vega-embed\"))\n",
       "        .catch(showError)\n",
       "        .then(() => displayChart(vegaEmbed));\n",
       "    }\n",
       "  })({\"config\": {\"view\": {\"height\": 300, \"width\": 400}, \"mark\": {\"color\": \"#1eafae\"}}, \"data\": {\"name\": \"data-8d5d1ee392d8e452bad0eca3307d86e5\"}, \"mark\": {\"type\": \"line\", \"interpolate\": \"step-after\"}, \"encoding\": {\"x\": {\"type\": \"nominal\", \"field\": \"x\"}, \"y\": {\"type\": \"quantitative\", \"field\": \"y\"}}, \"$schema\": \"https://vega.github.io/schema/vega-lite/v4.0.2.json\", \"datasets\": {\"data-8d5d1ee392d8e452bad0eca3307d86e5\": [{\"x\": \"Mon.\", \"y\": 76, \"z\": 37, \"h\": 3, \"k\": \"a\"}, {\"x\": \"Tue.\", \"y\": 37, \"z\": 46, \"h\": 1, \"k\": \"a\"}, {\"x\": \"Wed.\", \"y\": 90, \"z\": 53, \"h\": 5, \"k\": \"c\"}, {\"x\": \"Thu.\", \"y\": 60, \"z\": 81, \"h\": 4, \"k\": \"d\"}, {\"x\": \"Fri.\", \"y\": 50, \"z\": 60, \"h\": 2, \"k\": \"c\"}]}}, {\"mode\": \"vega-lite\"});\n",
       "</script>"
      ],
      "text/plain": [
       "alt.Chart(...)"
      ]
     },
     "execution_count": 138,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "alt.Chart(d1).mark_line(interpolate='step-after').encode(\n",
    "    x='x',\n",
    "    y='y'\n",
    ") #阶梯线"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 139,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "\n",
       "<div id=\"altair-viz-61848a7531984604b3d60e9630718307\"></div>\n",
       "<script type=\"text/javascript\">\n",
       "  (function(spec, embedOpt){\n",
       "    const outputDiv = document.getElementById(\"altair-viz-61848a7531984604b3d60e9630718307\");\n",
       "    const paths = {\n",
       "      \"vega\": \"https://cdn.jsdelivr.net/npm//vega@5?noext\",\n",
       "      \"vega-lib\": \"https://cdn.jsdelivr.net/npm//vega-lib?noext\",\n",
       "      \"vega-lite\": \"https://cdn.jsdelivr.net/npm//vega-lite@4.0.2?noext\",\n",
       "      \"vega-embed\": \"https://cdn.jsdelivr.net/npm//vega-embed@6?noext\",\n",
       "    };\n",
       "\n",
       "    function loadScript(lib) {\n",
       "      return new Promise(function(resolve, reject) {\n",
       "        var s = document.createElement('script');\n",
       "        s.src = paths[lib];\n",
       "        s.async = true;\n",
       "        s.onload = () => resolve(paths[lib]);\n",
       "        s.onerror = () => reject(`Error loading script: ${paths[lib]}`);\n",
       "        document.getElementsByTagName(\"head\")[0].appendChild(s);\n",
       "      });\n",
       "    }\n",
       "\n",
       "    function showError(err) {\n",
       "      outputDiv.innerHTML = `<div class=\"error\" style=\"color:red;\">${err}</div>`;\n",
       "      throw err;\n",
       "    }\n",
       "\n",
       "    function displayChart(vegaEmbed) {\n",
       "      vegaEmbed(outputDiv, spec, embedOpt)\n",
       "        .catch(err => showError(`Javascript Error: ${err.message}<br>This usually means there's a typo in your chart specification. See the javascript console for the full traceback.`));\n",
       "    }\n",
       "\n",
       "    if(typeof define === \"function\" && define.amd) {\n",
       "      requirejs.config({paths});\n",
       "      require([\"vega-embed\"], displayChart, err => showError(`Error loading script: ${err.message}`));\n",
       "    } else if (typeof vegaEmbed === \"function\") {\n",
       "      displayChart(vegaEmbed);\n",
       "    } else {\n",
       "      loadScript(\"vega\")\n",
       "        .then(() => loadScript(\"vega-lite\"))\n",
       "        .then(() => loadScript(\"vega-embed\"))\n",
       "        .catch(showError)\n",
       "        .then(() => displayChart(vegaEmbed));\n",
       "    }\n",
       "  })({\"config\": {\"view\": {\"height\": 300, \"width\": 400}, \"mark\": {\"color\": \"#1eafae\"}}, \"layer\": [{\"mark\": {\"type\": \"errorband\", \"extent\": \"ci\"}, \"encoding\": {\"x\": {\"type\": \"nominal\", \"field\": \"x\"}, \"y\": {\"type\": \"quantitative\", \"field\": \"y\", \"title\": \"tty\"}}}, {\"mark\": \"line\", \"encoding\": {\"x\": {\"type\": \"nominal\", \"field\": \"x\"}, \"y\": {\"type\": \"quantitative\", \"field\": \"y\"}}}], \"data\": {\"name\": \"data-8d5d1ee392d8e452bad0eca3307d86e5\"}, \"$schema\": \"https://vega.github.io/schema/vega-lite/v4.0.2.json\", \"datasets\": {\"data-8d5d1ee392d8e452bad0eca3307d86e5\": [{\"x\": \"Mon.\", \"y\": 76, \"z\": 37, \"h\": 3, \"k\": \"a\"}, {\"x\": \"Tue.\", \"y\": 37, \"z\": 46, \"h\": 1, \"k\": \"a\"}, {\"x\": \"Wed.\", \"y\": 90, \"z\": 53, \"h\": 5, \"k\": \"c\"}, {\"x\": \"Thu.\", \"y\": 60, \"z\": 81, \"h\": 4, \"k\": \"d\"}, {\"x\": \"Fri.\", \"y\": 50, \"z\": 60, \"h\": 2, \"k\": \"c\"}]}}, {\"mode\": \"vega-lite\"});\n",
       "</script>"
      ],
      "text/plain": [
       "alt.LayerChart(...)"
      ]
     },
     "execution_count": 139,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "#给曲线加上置信区间\n",
    "\n",
    "line = alt.Chart(d1).mark_line().encode(\n",
    "    x='x',\n",
    "    y='y'\n",
    ")\n",
    "\n",
    "band = alt.Chart(d1).mark_errorband(extent='ci').encode(\n",
    "    x='x',\n",
    "    y=alt.Y('y', title='tty'),\n",
    ")\n",
    "\n",
    "band + line"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "#柱状图"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "\n",
       "<div id=\"altair-viz-b3f475c797674208b0f634be2381fcc1\"></div>\n",
       "<script type=\"text/javascript\">\n",
       "  (function(spec, embedOpt){\n",
       "    const outputDiv = document.getElementById(\"altair-viz-b3f475c797674208b0f634be2381fcc1\");\n",
       "    const paths = {\n",
       "      \"vega\": \"https://cdn.jsdelivr.net/npm//vega@5?noext\",\n",
       "      \"vega-lib\": \"https://cdn.jsdelivr.net/npm//vega-lib?noext\",\n",
       "      \"vega-lite\": \"https://cdn.jsdelivr.net/npm//vega-lite@4.0.2?noext\",\n",
       "      \"vega-embed\": \"https://cdn.jsdelivr.net/npm//vega-embed@6?noext\",\n",
       "    };\n",
       "\n",
       "    function loadScript(lib) {\n",
       "      return new Promise(function(resolve, reject) {\n",
       "        var s = document.createElement('script');\n",
       "        s.src = paths[lib];\n",
       "        s.async = true;\n",
       "        s.onload = () => resolve(paths[lib]);\n",
       "        s.onerror = () => reject(`Error loading script: ${paths[lib]}`);\n",
       "        document.getElementsByTagName(\"head\")[0].appendChild(s);\n",
       "      });\n",
       "    }\n",
       "\n",
       "    function showError(err) {\n",
       "      outputDiv.innerHTML = `<div class=\"error\" style=\"color:red;\">${err}</div>`;\n",
       "      throw err;\n",
       "    }\n",
       "\n",
       "    function displayChart(vegaEmbed) {\n",
       "      vegaEmbed(outputDiv, spec, embedOpt)\n",
       "        .catch(err => showError(`Javascript Error: ${err.message}<br>This usually means there's a typo in your chart specification. See the javascript console for the full traceback.`));\n",
       "    }\n",
       "\n",
       "    if(typeof define === \"function\" && define.amd) {\n",
       "      requirejs.config({paths});\n",
       "      require([\"vega-embed\"], displayChart, err => showError(`Error loading script: ${err.message}`));\n",
       "    } else if (typeof vegaEmbed === \"function\") {\n",
       "      displayChart(vegaEmbed);\n",
       "    } else {\n",
       "      loadScript(\"vega\")\n",
       "        .then(() => loadScript(\"vega-lite\"))\n",
       "        .then(() => loadScript(\"vega-embed\"))\n",
       "        .catch(showError)\n",
       "        .then(() => displayChart(vegaEmbed));\n",
       "    }\n",
       "  })({\"config\": {\"view\": {\"continuousWidth\": 400, \"continuousHeight\": 300}}, \"data\": {\"name\": \"data-8d5d1ee392d8e452bad0eca3307d86e5\"}, \"mark\": \"bar\", \"encoding\": {\"x\": {\"type\": \"nominal\", \"field\": \"x\"}, \"y\": {\"type\": \"quantitative\", \"field\": \"y\"}}, \"$schema\": \"https://vega.github.io/schema/vega-lite/v4.0.2.json\", \"datasets\": {\"data-8d5d1ee392d8e452bad0eca3307d86e5\": [{\"x\": \"Mon.\", \"y\": 76, \"z\": 37, \"h\": 3, \"k\": \"a\"}, {\"x\": \"Tue.\", \"y\": 37, \"z\": 46, \"h\": 1, \"k\": \"a\"}, {\"x\": \"Wed.\", \"y\": 90, \"z\": 53, \"h\": 5, \"k\": \"c\"}, {\"x\": \"Thu.\", \"y\": 60, \"z\": 81, \"h\": 4, \"k\": \"d\"}, {\"x\": \"Fri.\", \"y\": 50, \"z\": 60, \"h\": 2, \"k\": \"c\"}]}}, {\"mode\": \"vega-lite\"});\n",
       "</script>"
      ],
      "text/plain": [
       "alt.Chart(...)"
      ]
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "alt.Chart(d1).mark_bar().encode(\n",
    "    x='x',\n",
    "    y='y'\n",
    ")                                   #没发现它的顺序很诡异么？会对x轴排了序"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "#调图表细节，加title，柱宽度？"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "#给柱状图标上标签  https://altair-viz.github.io/gallery/bar_chart_with_labels.html"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 140,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "\n",
       "<div id=\"altair-viz-49e42fcba94d4ba79d3ca6fbd955555c\"></div>\n",
       "<script type=\"text/javascript\">\n",
       "  (function(spec, embedOpt){\n",
       "    const outputDiv = document.getElementById(\"altair-viz-49e42fcba94d4ba79d3ca6fbd955555c\");\n",
       "    const paths = {\n",
       "      \"vega\": \"https://cdn.jsdelivr.net/npm//vega@5?noext\",\n",
       "      \"vega-lib\": \"https://cdn.jsdelivr.net/npm//vega-lib?noext\",\n",
       "      \"vega-lite\": \"https://cdn.jsdelivr.net/npm//vega-lite@4.0.2?noext\",\n",
       "      \"vega-embed\": \"https://cdn.jsdelivr.net/npm//vega-embed@6?noext\",\n",
       "    };\n",
       "\n",
       "    function loadScript(lib) {\n",
       "      return new Promise(function(resolve, reject) {\n",
       "        var s = document.createElement('script');\n",
       "        s.src = paths[lib];\n",
       "        s.async = true;\n",
       "        s.onload = () => resolve(paths[lib]);\n",
       "        s.onerror = () => reject(`Error loading script: ${paths[lib]}`);\n",
       "        document.getElementsByTagName(\"head\")[0].appendChild(s);\n",
       "      });\n",
       "    }\n",
       "\n",
       "    function showError(err) {\n",
       "      outputDiv.innerHTML = `<div class=\"error\" style=\"color:red;\">${err}</div>`;\n",
       "      throw err;\n",
       "    }\n",
       "\n",
       "    function displayChart(vegaEmbed) {\n",
       "      vegaEmbed(outputDiv, spec, embedOpt)\n",
       "        .catch(err => showError(`Javascript Error: ${err.message}<br>This usually means there's a typo in your chart specification. See the javascript console for the full traceback.`));\n",
       "    }\n",
       "\n",
       "    if(typeof define === \"function\" && define.amd) {\n",
       "      requirejs.config({paths});\n",
       "      require([\"vega-embed\"], displayChart, err => showError(`Error loading script: ${err.message}`));\n",
       "    } else if (typeof vegaEmbed === \"function\") {\n",
       "      displayChart(vegaEmbed);\n",
       "    } else {\n",
       "      loadScript(\"vega\")\n",
       "        .then(() => loadScript(\"vega-lite\"))\n",
       "        .then(() => loadScript(\"vega-embed\"))\n",
       "        .catch(showError)\n",
       "        .then(() => displayChart(vegaEmbed));\n",
       "    }\n",
       "  })({\"config\": {\"view\": {\"height\": 300, \"width\": 400}, \"mark\": {\"color\": \"#1eafae\"}, \"title\": {\"anchor\": \"middle\", \"color\": \"gray\", \"fontSize\": 20}}, \"layer\": [{\"mark\": \"bar\", \"encoding\": {\"x\": {\"type\": \"nominal\", \"field\": \"x\"}, \"y\": {\"type\": \"quantitative\", \"field\": \"y\"}}, \"width\": 400}, {\"mark\": {\"type\": \"text\", \"baseline\": \"top\"}, \"encoding\": {\"text\": {\"type\": \"quantitative\", \"field\": \"y\"}, \"x\": {\"type\": \"nominal\", \"field\": \"x\"}, \"y\": {\"type\": \"quantitative\", \"field\": \"y\"}}, \"width\": 400}], \"data\": {\"name\": \"data-8d5d1ee392d8e452bad0eca3307d86e5\"}, \"title\": \"weekly ride\", \"$schema\": \"https://vega.github.io/schema/vega-lite/v4.0.2.json\", \"datasets\": {\"data-8d5d1ee392d8e452bad0eca3307d86e5\": [{\"x\": \"Mon.\", \"y\": 76, \"z\": 37, \"h\": 3, \"k\": \"a\"}, {\"x\": \"Tue.\", \"y\": 37, \"z\": 46, \"h\": 1, \"k\": \"a\"}, {\"x\": \"Wed.\", \"y\": 90, \"z\": 53, \"h\": 5, \"k\": \"c\"}, {\"x\": \"Thu.\", \"y\": 60, \"z\": 81, \"h\": 4, \"k\": \"d\"}, {\"x\": \"Fri.\", \"y\": 50, \"z\": 60, \"h\": 2, \"k\": \"c\"}]}}, {\"mode\": \"vega-lite\"});\n",
       "</script>"
      ],
      "text/plain": [
       "alt.LayerChart(...)"
      ]
     },
     "execution_count": 140,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "bar=alt.Chart(d1,width=400).mark_bar().encode(\n",
    "    x='x',\n",
    "    y='y'\n",
    ")\n",
    "t=bar.mark_text(\n",
    "    baseline='top',\n",
    "    ).encode(text='y')\n",
    "\n",
    "(bar+t).properties(\n",
    "    title='weekly ride'\n",
    ").configure_title(\n",
    "    fontSize=20,\n",
    "    anchor='middle',\n",
    "    color='gray'\n",
    ")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "#堆叠柱"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 142,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "\n",
       "<div id=\"altair-viz-f03b50cf7a2e4da0a46692e20058e507\"></div>\n",
       "<script type=\"text/javascript\">\n",
       "  (function(spec, embedOpt){\n",
       "    const outputDiv = document.getElementById(\"altair-viz-f03b50cf7a2e4da0a46692e20058e507\");\n",
       "    const paths = {\n",
       "      \"vega\": \"https://cdn.jsdelivr.net/npm//vega@5?noext\",\n",
       "      \"vega-lib\": \"https://cdn.jsdelivr.net/npm//vega-lib?noext\",\n",
       "      \"vega-lite\": \"https://cdn.jsdelivr.net/npm//vega-lite@4.0.2?noext\",\n",
       "      \"vega-embed\": \"https://cdn.jsdelivr.net/npm//vega-embed@6?noext\",\n",
       "    };\n",
       "\n",
       "    function loadScript(lib) {\n",
       "      return new Promise(function(resolve, reject) {\n",
       "        var s = document.createElement('script');\n",
       "        s.src = paths[lib];\n",
       "        s.async = true;\n",
       "        s.onload = () => resolve(paths[lib]);\n",
       "        s.onerror = () => reject(`Error loading script: ${paths[lib]}`);\n",
       "        document.getElementsByTagName(\"head\")[0].appendChild(s);\n",
       "      });\n",
       "    }\n",
       "\n",
       "    function showError(err) {\n",
       "      outputDiv.innerHTML = `<div class=\"error\" style=\"color:red;\">${err}</div>`;\n",
       "      throw err;\n",
       "    }\n",
       "\n",
       "    function displayChart(vegaEmbed) {\n",
       "      vegaEmbed(outputDiv, spec, embedOpt)\n",
       "        .catch(err => showError(`Javascript Error: ${err.message}<br>This usually means there's a typo in your chart specification. See the javascript console for the full traceback.`));\n",
       "    }\n",
       "\n",
       "    if(typeof define === \"function\" && define.amd) {\n",
       "      requirejs.config({paths});\n",
       "      require([\"vega-embed\"], displayChart, err => showError(`Error loading script: ${err.message}`));\n",
       "    } else if (typeof vegaEmbed === \"function\") {\n",
       "      displayChart(vegaEmbed);\n",
       "    } else {\n",
       "      loadScript(\"vega\")\n",
       "        .then(() => loadScript(\"vega-lite\"))\n",
       "        .then(() => loadScript(\"vega-embed\"))\n",
       "        .catch(showError)\n",
       "        .then(() => displayChart(vegaEmbed));\n",
       "    }\n",
       "  })({\"config\": {\"view\": {\"height\": 300, \"width\": 400}, \"mark\": {\"color\": \"#1eafae\"}}, \"data\": {\"name\": \"data-8d5d1ee392d8e452bad0eca3307d86e5\"}, \"mark\": \"bar\", \"encoding\": {\"x\": {\"type\": \"nominal\", \"field\": \"x\"}, \"y\": {\"type\": \"quantitative\", \"field\": \"y\"}, \"y2\": {\"field\": \"z\"}}, \"height\": 300, \"width\": 400, \"$schema\": \"https://vega.github.io/schema/vega-lite/v4.0.2.json\", \"datasets\": {\"data-8d5d1ee392d8e452bad0eca3307d86e5\": [{\"x\": \"Mon.\", \"y\": 76, \"z\": 37, \"h\": 3, \"k\": \"a\"}, {\"x\": \"Tue.\", \"y\": 37, \"z\": 46, \"h\": 1, \"k\": \"a\"}, {\"x\": \"Wed.\", \"y\": 90, \"z\": 53, \"h\": 5, \"k\": \"c\"}, {\"x\": \"Thu.\", \"y\": 60, \"z\": 81, \"h\": 4, \"k\": \"d\"}, {\"x\": \"Fri.\", \"y\": 50, \"z\": 60, \"h\": 2, \"k\": \"c\"}]}}, {\"mode\": \"vega-lite\"});\n",
       "</script>"
      ],
      "text/plain": [
       "alt.Chart(...)"
      ]
     },
     "execution_count": 142,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "bar=alt.Chart(df,width=400,height=300).mark_bar().encode(\n",
    "    x='x',\n",
    "    y='y',\n",
    "    y2='z'\n",
    ")\n",
    "bar"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "#条形图"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 143,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "\n",
       "<div id=\"altair-viz-87e6768d7dcb4d7aad79fd4076c43178\"></div>\n",
       "<script type=\"text/javascript\">\n",
       "  (function(spec, embedOpt){\n",
       "    const outputDiv = document.getElementById(\"altair-viz-87e6768d7dcb4d7aad79fd4076c43178\");\n",
       "    const paths = {\n",
       "      \"vega\": \"https://cdn.jsdelivr.net/npm//vega@5?noext\",\n",
       "      \"vega-lib\": \"https://cdn.jsdelivr.net/npm//vega-lib?noext\",\n",
       "      \"vega-lite\": \"https://cdn.jsdelivr.net/npm//vega-lite@4.0.2?noext\",\n",
       "      \"vega-embed\": \"https://cdn.jsdelivr.net/npm//vega-embed@6?noext\",\n",
       "    };\n",
       "\n",
       "    function loadScript(lib) {\n",
       "      return new Promise(function(resolve, reject) {\n",
       "        var s = document.createElement('script');\n",
       "        s.src = paths[lib];\n",
       "        s.async = true;\n",
       "        s.onload = () => resolve(paths[lib]);\n",
       "        s.onerror = () => reject(`Error loading script: ${paths[lib]}`);\n",
       "        document.getElementsByTagName(\"head\")[0].appendChild(s);\n",
       "      });\n",
       "    }\n",
       "\n",
       "    function showError(err) {\n",
       "      outputDiv.innerHTML = `<div class=\"error\" style=\"color:red;\">${err}</div>`;\n",
       "      throw err;\n",
       "    }\n",
       "\n",
       "    function displayChart(vegaEmbed) {\n",
       "      vegaEmbed(outputDiv, spec, embedOpt)\n",
       "        .catch(err => showError(`Javascript Error: ${err.message}<br>This usually means there's a typo in your chart specification. See the javascript console for the full traceback.`));\n",
       "    }\n",
       "\n",
       "    if(typeof define === \"function\" && define.amd) {\n",
       "      requirejs.config({paths});\n",
       "      require([\"vega-embed\"], displayChart, err => showError(`Error loading script: ${err.message}`));\n",
       "    } else if (typeof vegaEmbed === \"function\") {\n",
       "      displayChart(vegaEmbed);\n",
       "    } else {\n",
       "      loadScript(\"vega\")\n",
       "        .then(() => loadScript(\"vega-lite\"))\n",
       "        .then(() => loadScript(\"vega-embed\"))\n",
       "        .catch(showError)\n",
       "        .then(() => displayChart(vegaEmbed));\n",
       "    }\n",
       "  })({\"config\": {\"view\": {\"height\": 300, \"width\": 400}, \"mark\": {\"color\": \"#1eafae\"}}, \"data\": {\"name\": \"data-8d5d1ee392d8e452bad0eca3307d86e5\"}, \"mark\": \"bar\", \"encoding\": {\"x\": {\"type\": \"quantitative\", \"field\": \"y\"}, \"y\": {\"type\": \"nominal\", \"field\": \"x\"}}, \"$schema\": \"https://vega.github.io/schema/vega-lite/v4.0.2.json\", \"datasets\": {\"data-8d5d1ee392d8e452bad0eca3307d86e5\": [{\"x\": \"Mon.\", \"y\": 76, \"z\": 37, \"h\": 3, \"k\": \"a\"}, {\"x\": \"Tue.\", \"y\": 37, \"z\": 46, \"h\": 1, \"k\": \"a\"}, {\"x\": \"Wed.\", \"y\": 90, \"z\": 53, \"h\": 5, \"k\": \"c\"}, {\"x\": \"Thu.\", \"y\": 60, \"z\": 81, \"h\": 4, \"k\": \"d\"}, {\"x\": \"Fri.\", \"y\": 50, \"z\": 60, \"h\": 2, \"k\": \"c\"}]}}, {\"mode\": \"vega-lite\"});\n",
       "</script>"
      ],
      "text/plain": [
       "alt.Chart(...)"
      ]
     },
     "execution_count": 143,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "alt.Chart(d1).mark_bar().encode(\n",
    "    x='y', #交换x和y\n",
    "    y='x'\n",
    ")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 145,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "\n",
       "<div id=\"altair-viz-a7a0e578ad904447b6d25d252ae54507\"></div>\n",
       "<script type=\"text/javascript\">\n",
       "  (function(spec, embedOpt){\n",
       "    const outputDiv = document.getElementById(\"altair-viz-a7a0e578ad904447b6d25d252ae54507\");\n",
       "    const paths = {\n",
       "      \"vega\": \"https://cdn.jsdelivr.net/npm//vega@5?noext\",\n",
       "      \"vega-lib\": \"https://cdn.jsdelivr.net/npm//vega-lib?noext\",\n",
       "      \"vega-lite\": \"https://cdn.jsdelivr.net/npm//vega-lite@4.0.2?noext\",\n",
       "      \"vega-embed\": \"https://cdn.jsdelivr.net/npm//vega-embed@6?noext\",\n",
       "    };\n",
       "\n",
       "    function loadScript(lib) {\n",
       "      return new Promise(function(resolve, reject) {\n",
       "        var s = document.createElement('script');\n",
       "        s.src = paths[lib];\n",
       "        s.async = true;\n",
       "        s.onload = () => resolve(paths[lib]);\n",
       "        s.onerror = () => reject(`Error loading script: ${paths[lib]}`);\n",
       "        document.getElementsByTagName(\"head\")[0].appendChild(s);\n",
       "      });\n",
       "    }\n",
       "\n",
       "    function showError(err) {\n",
       "      outputDiv.innerHTML = `<div class=\"error\" style=\"color:red;\">${err}</div>`;\n",
       "      throw err;\n",
       "    }\n",
       "\n",
       "    function displayChart(vegaEmbed) {\n",
       "      vegaEmbed(outputDiv, spec, embedOpt)\n",
       "        .catch(err => showError(`Javascript Error: ${err.message}<br>This usually means there's a typo in your chart specification. See the javascript console for the full traceback.`));\n",
       "    }\n",
       "\n",
       "    if(typeof define === \"function\" && define.amd) {\n",
       "      requirejs.config({paths});\n",
       "      require([\"vega-embed\"], displayChart, err => showError(`Error loading script: ${err.message}`));\n",
       "    } else if (typeof vegaEmbed === \"function\") {\n",
       "      displayChart(vegaEmbed);\n",
       "    } else {\n",
       "      loadScript(\"vega\")\n",
       "        .then(() => loadScript(\"vega-lite\"))\n",
       "        .then(() => loadScript(\"vega-embed\"))\n",
       "        .catch(showError)\n",
       "        .then(() => displayChart(vegaEmbed));\n",
       "    }\n",
       "  })({\"config\": {\"view\": {\"height\": 300, \"width\": 400}, \"mark\": {\"color\": \"#1eafae\"}}, \"data\": {\"name\": \"data-8d5d1ee392d8e452bad0eca3307d86e5\"}, \"mark\": \"bar\", \"encoding\": {\"x\": {\"type\": \"quantitative\", \"field\": \"y\", \"sort\": \"descending\", \"title\": \"pop\"}, \"y\": {\"type\": \"ordinal\", \"axis\": null, \"field\": \"x\"}}, \"$schema\": \"https://vega.github.io/schema/vega-lite/v4.0.2.json\", \"datasets\": {\"data-8d5d1ee392d8e452bad0eca3307d86e5\": [{\"x\": \"Mon.\", \"y\": 76, \"z\": 37, \"h\": 3, \"k\": \"a\"}, {\"x\": \"Tue.\", \"y\": 37, \"z\": 46, \"h\": 1, \"k\": \"a\"}, {\"x\": \"Wed.\", \"y\": 90, \"z\": 53, \"h\": 5, \"k\": \"c\"}, {\"x\": \"Thu.\", \"y\": 60, \"z\": 81, \"h\": 4, \"k\": \"d\"}, {\"x\": \"Fri.\", \"y\": 50, \"z\": 60, \"h\": 2, \"k\": \"c\"}]}}, {\"mode\": \"vega-lite\"});\n",
       "</script>"
      ],
      "text/plain": [
       "alt.Chart(...)"
      ]
     },
     "execution_count": 145,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "left =  alt.Chart(d1).mark_bar().encode(\n",
    "    y=alt.Y('x:O', axis=None),\n",
    "    x=alt.X('y',\n",
    "            title='pop',\n",
    "            sort=alt.SortOrder('descending'))\n",
    ")\n",
    "\n",
    "left"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "#蝴蝶图"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 150,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "\n",
       "<div id=\"altair-viz-b3f94f6dbc664d6eb3d328f7578f0228\"></div>\n",
       "<script type=\"text/javascript\">\n",
       "  (function(spec, embedOpt){\n",
       "    const outputDiv = document.getElementById(\"altair-viz-b3f94f6dbc664d6eb3d328f7578f0228\");\n",
       "    const paths = {\n",
       "      \"vega\": \"https://cdn.jsdelivr.net/npm//vega@5?noext\",\n",
       "      \"vega-lib\": \"https://cdn.jsdelivr.net/npm//vega-lib?noext\",\n",
       "      \"vega-lite\": \"https://cdn.jsdelivr.net/npm//vega-lite@4.0.2?noext\",\n",
       "      \"vega-embed\": \"https://cdn.jsdelivr.net/npm//vega-embed@6?noext\",\n",
       "    };\n",
       "\n",
       "    function loadScript(lib) {\n",
       "      return new Promise(function(resolve, reject) {\n",
       "        var s = document.createElement('script');\n",
       "        s.src = paths[lib];\n",
       "        s.async = true;\n",
       "        s.onload = () => resolve(paths[lib]);\n",
       "        s.onerror = () => reject(`Error loading script: ${paths[lib]}`);\n",
       "        document.getElementsByTagName(\"head\")[0].appendChild(s);\n",
       "      });\n",
       "    }\n",
       "\n",
       "    function showError(err) {\n",
       "      outputDiv.innerHTML = `<div class=\"error\" style=\"color:red;\">${err}</div>`;\n",
       "      throw err;\n",
       "    }\n",
       "\n",
       "    function displayChart(vegaEmbed) {\n",
       "      vegaEmbed(outputDiv, spec, embedOpt)\n",
       "        .catch(err => showError(`Javascript Error: ${err.message}<br>This usually means there's a typo in your chart specification. See the javascript console for the full traceback.`));\n",
       "    }\n",
       "\n",
       "    if(typeof define === \"function\" && define.amd) {\n",
       "      requirejs.config({paths});\n",
       "      require([\"vega-embed\"], displayChart, err => showError(`Error loading script: ${err.message}`));\n",
       "    } else if (typeof vegaEmbed === \"function\") {\n",
       "      displayChart(vegaEmbed);\n",
       "    } else {\n",
       "      loadScript(\"vega\")\n",
       "        .then(() => loadScript(\"vega-lite\"))\n",
       "        .then(() => loadScript(\"vega-embed\"))\n",
       "        .catch(showError)\n",
       "        .then(() => displayChart(vegaEmbed));\n",
       "    }\n",
       "  })({\"config\": {\"view\": {\"height\": 300, \"width\": 400}, \"mark\": {\"color\": \"#1eafae\"}}, \"concat\": [{\"mark\": {\"type\": \"bar\", \"color\": \"#1eafae\"}, \"encoding\": {\"x\": {\"type\": \"quantitative\", \"field\": \"y\", \"sort\": \"descending\", \"title\": \"pop\"}, \"y\": {\"type\": \"ordinal\", \"axis\": null, \"field\": \"x\"}}, \"title\": \"Female\", \"width\": 300}, {\"mark\": \"text\", \"encoding\": {\"text\": {\"type\": \"nominal\", \"field\": \"x\"}, \"y\": {\"type\": \"nominal\", \"axis\": null, \"field\": \"x\"}}, \"width\": 30}, {\"mark\": {\"type\": \"bar\", \"color\": \"#ffa069\"}, \"encoding\": {\"x\": {\"type\": \"quantitative\", \"field\": \"z\", \"title\": \"pop\"}, \"y\": {\"type\": \"nominal\", \"axis\": null, \"field\": \"x\"}}, \"title\": \"Male\", \"width\": 300}], \"data\": {\"name\": \"data-8d5d1ee392d8e452bad0eca3307d86e5\"}, \"spacing\": 5, \"$schema\": \"https://vega.github.io/schema/vega-lite/v4.0.2.json\", \"datasets\": {\"data-8d5d1ee392d8e452bad0eca3307d86e5\": [{\"x\": \"Mon.\", \"y\": 76, \"z\": 37, \"h\": 3, \"k\": \"a\"}, {\"x\": \"Tue.\", \"y\": 37, \"z\": 46, \"h\": 1, \"k\": \"a\"}, {\"x\": \"Wed.\", \"y\": 90, \"z\": 53, \"h\": 5, \"k\": \"c\"}, {\"x\": \"Thu.\", \"y\": 60, \"z\": 81, \"h\": 4, \"k\": \"d\"}, {\"x\": \"Fri.\", \"y\": 50, \"z\": 60, \"h\": 2, \"k\": \"c\"}]}}, {\"mode\": \"vega-lite\"});\n",
       "</script>"
      ],
      "text/plain": [
       "alt.ConcatChart(...)"
      ]
     },
     "execution_count": 150,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "#https://altair-viz.github.io/gallery/us_population_pyramid_over_time.html\n",
    "\n",
    "left =  alt.Chart(d1,width=300).encode(\n",
    "    y=alt.Y('x:O', axis=None),\n",
    "    x=alt.X('y',\n",
    "            title='pop',\n",
    "            sort=alt.SortOrder('descending'))\n",
    ").mark_bar(color='#1eafae').properties(title='Female')\n",
    "\n",
    "middle =alt.Chart(d1).encode(\n",
    "    y=alt.Y('x', axis=None),\n",
    "    text=alt.Text('x')\n",
    ").mark_text().properties(width=30)\n",
    "\n",
    "right = alt.Chart(d1,width=300).encode(\n",
    "    y=alt.Y('x', axis=None),\n",
    "    x=alt.X('z', title='pop')\n",
    ").mark_bar(color='#ffa069').properties(title='Male')\n",
    "\n",
    "alt.concat(left,middle, right, spacing=5)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 129,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": 134,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "\n",
       "<div id=\"altair-viz-8215999257cc4f76a61a1d85e9150f20\"></div>\n",
       "<script type=\"text/javascript\">\n",
       "  (function(spec, embedOpt){\n",
       "    const outputDiv = document.getElementById(\"altair-viz-8215999257cc4f76a61a1d85e9150f20\");\n",
       "    const paths = {\n",
       "      \"vega\": \"https://cdn.jsdelivr.net/npm//vega@5?noext\",\n",
       "      \"vega-lib\": \"https://cdn.jsdelivr.net/npm//vega-lib?noext\",\n",
       "      \"vega-lite\": \"https://cdn.jsdelivr.net/npm//vega-lite@4.0.2?noext\",\n",
       "      \"vega-embed\": \"https://cdn.jsdelivr.net/npm//vega-embed@6?noext\",\n",
       "    };\n",
       "\n",
       "    function loadScript(lib) {\n",
       "      return new Promise(function(resolve, reject) {\n",
       "        var s = document.createElement('script');\n",
       "        s.src = paths[lib];\n",
       "        s.async = true;\n",
       "        s.onload = () => resolve(paths[lib]);\n",
       "        s.onerror = () => reject(`Error loading script: ${paths[lib]}`);\n",
       "        document.getElementsByTagName(\"head\")[0].appendChild(s);\n",
       "      });\n",
       "    }\n",
       "\n",
       "    function showError(err) {\n",
       "      outputDiv.innerHTML = `<div class=\"error\" style=\"color:red;\">${err}</div>`;\n",
       "      throw err;\n",
       "    }\n",
       "\n",
       "    function displayChart(vegaEmbed) {\n",
       "      vegaEmbed(outputDiv, spec, embedOpt)\n",
       "        .catch(err => showError(`Javascript Error: ${err.message}<br>This usually means there's a typo in your chart specification. See the javascript console for the full traceback.`));\n",
       "    }\n",
       "\n",
       "    if(typeof define === \"function\" && define.amd) {\n",
       "      requirejs.config({paths});\n",
       "      require([\"vega-embed\"], displayChart, err => showError(`Error loading script: ${err.message}`));\n",
       "    } else if (typeof vegaEmbed === \"function\") {\n",
       "      displayChart(vegaEmbed);\n",
       "    } else {\n",
       "      loadScript(\"vega\")\n",
       "        .then(() => loadScript(\"vega-lite\"))\n",
       "        .then(() => loadScript(\"vega-embed\"))\n",
       "        .catch(showError)\n",
       "        .then(() => displayChart(vegaEmbed));\n",
       "    }\n",
       "  })({\"config\": {\"view\": {\"height\": 300, \"width\": 400}, \"mark\": {\"color\": \"#1eafae\", \"fill\": \"#1eafae\"}}, \"layer\": [{\"data\": {\"name\": \"data-b853e7ed13dc6c8b82d38657fd669290\"}, \"mark\": {\"type\": \"area\", \"color\": \"#FBC02D\"}, \"encoding\": {\"x\": {\"type\": \"quantitative\", \"field\": \"a\"}, \"y\": {\"type\": \"quantitative\", \"field\": \"b\"}}, \"selection\": {\"selector089\": {\"type\": \"interval\", \"bind\": \"scales\", \"encodings\": [\"x\", \"y\"]}}}, {\"data\": {\"name\": \"data-de8bea4fdb21823cbf883cb0959bd227\"}, \"mark\": {\"type\": \"area\", \"color\": \"#03A9F4\"}, \"encoding\": {\"x\": {\"type\": \"quantitative\", \"field\": \"a\"}, \"y\": {\"type\": \"quantitative\", \"field\": \"b\"}}, \"selection\": {\"selector090\": {\"type\": \"interval\", \"bind\": \"scales\", \"encodings\": [\"x\", \"y\"]}}}, {\"data\": {\"name\": \"data-b26d5d57caa70d06b90e59b80d794fee\"}, \"mark\": {\"type\": \"area\", \"color\": \"#4FC3F7\"}, \"encoding\": {\"x\": {\"type\": \"quantitative\", \"field\": \"a\"}, \"y\": {\"type\": \"quantitative\", \"field\": \"b\"}}, \"selection\": {\"selector091\": {\"type\": \"interval\", \"bind\": \"scales\", \"encodings\": [\"x\", \"y\"]}}}, {\"data\": {\"name\": \"data-3d556570508b1cbadce01ddeea68077e\"}, \"mark\": {\"type\": \"area\", \"color\": \"#B3E5FC\"}, \"encoding\": {\"x\": {\"type\": \"quantitative\", \"field\": \"a\"}, \"y\": {\"type\": \"quantitative\", \"field\": \"b\"}}, \"selection\": {\"selector092\": {\"type\": \"interval\", \"bind\": \"scales\", \"encodings\": [\"x\", \"y\"]}}}], \"$schema\": \"https://vega.github.io/schema/vega-lite/v4.0.2.json\", \"datasets\": {\"data-b853e7ed13dc6c8b82d38657fd669290\": [{\"a\": 0.0, \"b\": 0.0}, {\"a\": 10.1, \"b\": 100.2}], \"data-de8bea4fdb21823cbf883cb0959bd227\": [{\"a\": 10, \"b\": 100}, {\"a\": 20, \"b\": 100}], \"data-b26d5d57caa70d06b90e59b80d794fee\": [{\"a\": 18, \"b\": 70}, {\"a\": 28, \"b\": 70}], \"data-3d556570508b1cbadce01ddeea68077e\": [{\"a\": 26, \"b\": 40}, {\"a\": 36, \"b\": 40}]}}, {\"mode\": \"vega-lite\"});\n",
       "</script>"
      ],
      "text/plain": [
       "alt.LayerChart(...)"
      ]
     },
     "execution_count": 134,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "d3=pd.DataFrame({'a':[0,10.1],'b':[0,100.2]})\n",
    "d4=pd.DataFrame({'a':[10,20],'b':[100,100]})\n",
    "d5=pd.DataFrame({'a':[18,28],'b':[70,70]})\n",
    "d6=pd.DataFrame({'a':[26,36],'b':[40,40]})\n",
    "a1=alt.Chart(d3).mark_area(color='#FBC02D').encode(\n",
    "    x='a',\n",
    "    y='b'\n",
    ").interactive()\n",
    "a2=alt.Chart(d4).mark_area(color='#03A9F4').encode(\n",
    "    x='a',\n",
    "    y='b'\n",
    ").interactive()\n",
    "a3=alt.Chart(d5).mark_area(color='#4FC3F7').encode(\n",
    "    x='a',\n",
    "    y='b'\n",
    ").interactive()\n",
    "a4=alt.Chart(d6).mark_area(color='#B3E5FC').encode(\n",
    "    x='a',\n",
    "    y='b'\n",
    ").interactive()\n",
    "a1+a2+a3+a4"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": 109,
   "metadata": {},
   "outputs": [],
   "source": [
    "d4=pd.DataFrame({'a':[15,25,35],'b':[100,60,35],'w':['1','2','3']})"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 113,
   "metadata": {},
   "outputs": [],
   "source": [
    "scale = alt.Scale(domain=['1','2','3'],\n",
    "                  range=['#03A9F4','#4FC3F7','#B3E5FC'])\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "150\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>sepalLength</th>\n",
       "      <th>sepalWidth</th>\n",
       "      <th>petalLength</th>\n",
       "      <th>petalWidth</th>\n",
       "      <th>species</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>5.1</td>\n",
       "      <td>3.5</td>\n",
       "      <td>1.4</td>\n",
       "      <td>0.2</td>\n",
       "      <td>setosa</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>4.9</td>\n",
       "      <td>3.0</td>\n",
       "      <td>1.4</td>\n",
       "      <td>0.2</td>\n",
       "      <td>setosa</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   sepalLength  sepalWidth  petalLength  petalWidth species\n",
       "0          5.1         3.5          1.4         0.2  setosa\n",
       "1          4.9         3.0          1.4         0.2  setosa"
      ]
     },
     "execution_count": 18,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "from vega_datasets import data\n",
    "iris = data.iris()\n",
    "print(len(iris))\n",
    "iris.head(2)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 155,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "\n",
       "<div id=\"altair-viz-bb3f26521c204ecb899f96be2c5a5c36\"></div>\n",
       "<script type=\"text/javascript\">\n",
       "  (function(spec, embedOpt){\n",
       "    const outputDiv = document.getElementById(\"altair-viz-bb3f26521c204ecb899f96be2c5a5c36\");\n",
       "    const paths = {\n",
       "      \"vega\": \"https://cdn.jsdelivr.net/npm//vega@5?noext\",\n",
       "      \"vega-lib\": \"https://cdn.jsdelivr.net/npm//vega-lib?noext\",\n",
       "      \"vega-lite\": \"https://cdn.jsdelivr.net/npm//vega-lite@4.0.2?noext\",\n",
       "      \"vega-embed\": \"https://cdn.jsdelivr.net/npm//vega-embed@6?noext\",\n",
       "    };\n",
       "\n",
       "    function loadScript(lib) {\n",
       "      return new Promise(function(resolve, reject) {\n",
       "        var s = document.createElement('script');\n",
       "        s.src = paths[lib];\n",
       "        s.async = true;\n",
       "        s.onload = () => resolve(paths[lib]);\n",
       "        s.onerror = () => reject(`Error loading script: ${paths[lib]}`);\n",
       "        document.getElementsByTagName(\"head\")[0].appendChild(s);\n",
       "      });\n",
       "    }\n",
       "\n",
       "    function showError(err) {\n",
       "      outputDiv.innerHTML = `<div class=\"error\" style=\"color:red;\">${err}</div>`;\n",
       "      throw err;\n",
       "    }\n",
       "\n",
       "    function displayChart(vegaEmbed) {\n",
       "      vegaEmbed(outputDiv, spec, embedOpt)\n",
       "        .catch(err => showError(`Javascript Error: ${err.message}<br>This usually means there's a typo in your chart specification. See the javascript console for the full traceback.`));\n",
       "    }\n",
       "\n",
       "    if(typeof define === \"function\" && define.amd) {\n",
       "      requirejs.config({paths});\n",
       "      require([\"vega-embed\"], displayChart, err => showError(`Error loading script: ${err.message}`));\n",
       "    } else if (typeof vegaEmbed === \"function\") {\n",
       "      displayChart(vegaEmbed);\n",
       "    } else {\n",
       "      loadScript(\"vega\")\n",
       "        .then(() => loadScript(\"vega-lite\"))\n",
       "        .then(() => loadScript(\"vega-embed\"))\n",
       "        .catch(showError)\n",
       "        .then(() => displayChart(vegaEmbed));\n",
       "    }\n",
       "  })({\"config\": {\"view\": {\"height\": 300, \"width\": 400}, \"mark\": {\"color\": \"#1eafae\"}}, \"data\": {\"name\": \"data-a264acbd6e539a8b3afc0cb5f240fb57\"}, \"mark\": \"bar\", \"encoding\": {\"x\": {\"type\": \"quantitative\", \"bin\": {\"maxbins\": 20}, \"field\": \"sepalWidth\"}, \"y\": {\"type\": \"quantitative\", \"aggregate\": \"count\"}}, \"$schema\": \"https://vega.github.io/schema/vega-lite/v4.0.2.json\", \"datasets\": {\"data-a264acbd6e539a8b3afc0cb5f240fb57\": [{\"sepalLength\": 5.1, \"sepalWidth\": 3.5, \"petalLength\": 1.4, \"petalWidth\": 0.2, \"species\": \"setosa\"}, {\"sepalLength\": 4.9, \"sepalWidth\": 3.0, \"petalLength\": 1.4, \"petalWidth\": 0.2, \"species\": \"setosa\"}, {\"sepalLength\": 4.7, \"sepalWidth\": 3.2, \"petalLength\": 1.3, \"petalWidth\": 0.2, \"species\": \"setosa\"}, {\"sepalLength\": 4.6, \"sepalWidth\": 3.1, \"petalLength\": 1.5, \"petalWidth\": 0.2, \"species\": \"setosa\"}, {\"sepalLength\": 5.0, \"sepalWidth\": 3.6, \"petalLength\": 1.4, \"petalWidth\": 0.2, \"species\": \"setosa\"}, {\"sepalLength\": 5.4, \"sepalWidth\": 3.9, \"petalLength\": 1.7000000000000002, \"petalWidth\": 0.4, \"species\": \"setosa\"}, {\"sepalLength\": 4.6, \"sepalWidth\": 3.4, \"petalLength\": 1.4, \"petalWidth\": 0.30000000000000004, \"species\": \"setosa\"}, {\"sepalLength\": 5.0, \"sepalWidth\": 3.4, \"petalLength\": 1.5, \"petalWidth\": 0.2, \"species\": \"setosa\"}, {\"sepalLength\": 4.4, \"sepalWidth\": 2.9, \"petalLength\": 1.4, \"petalWidth\": 0.2, \"species\": \"setosa\"}, {\"sepalLength\": 4.9, \"sepalWidth\": 3.1, \"petalLength\": 1.5, \"petalWidth\": 0.1, \"species\": \"setosa\"}, {\"sepalLength\": 5.4, \"sepalWidth\": 3.7, \"petalLength\": 1.5, \"petalWidth\": 0.2, \"species\": \"setosa\"}, {\"sepalLength\": 4.8, \"sepalWidth\": 3.4, \"petalLength\": 1.6, \"petalWidth\": 0.2, \"species\": \"setosa\"}, {\"sepalLength\": 4.8, \"sepalWidth\": 3.0, \"petalLength\": 1.4, \"petalWidth\": 0.1, \"species\": \"setosa\"}, {\"sepalLength\": 4.3, \"sepalWidth\": 3.0, \"petalLength\": 1.1, \"petalWidth\": 0.1, \"species\": \"setosa\"}, {\"sepalLength\": 5.8, \"sepalWidth\": 4.0, \"petalLength\": 1.2, \"petalWidth\": 0.2, \"species\": \"setosa\"}, {\"sepalLength\": 5.7, \"sepalWidth\": 4.4, \"petalLength\": 1.5, \"petalWidth\": 0.4, \"species\": \"setosa\"}, {\"sepalLength\": 5.4, \"sepalWidth\": 3.9, \"petalLength\": 1.3, \"petalWidth\": 0.4, \"species\": \"setosa\"}, {\"sepalLength\": 5.1, \"sepalWidth\": 3.5, \"petalLength\": 1.4, \"petalWidth\": 0.30000000000000004, \"species\": \"setosa\"}, {\"sepalLength\": 5.7, \"sepalWidth\": 3.8, \"petalLength\": 1.7000000000000002, \"petalWidth\": 0.30000000000000004, \"species\": \"setosa\"}, {\"sepalLength\": 5.1, \"sepalWidth\": 3.8, \"petalLength\": 1.5, \"petalWidth\": 0.30000000000000004, \"species\": \"setosa\"}, {\"sepalLength\": 5.4, \"sepalWidth\": 3.4, \"petalLength\": 1.7000000000000002, \"petalWidth\": 0.2, \"species\": \"setosa\"}, {\"sepalLength\": 5.1, \"sepalWidth\": 3.7, \"petalLength\": 1.5, \"petalWidth\": 0.4, \"species\": \"setosa\"}, {\"sepalLength\": 4.6, \"sepalWidth\": 3.6, \"petalLength\": 1.0, \"petalWidth\": 0.2, \"species\": \"setosa\"}, {\"sepalLength\": 5.1, \"sepalWidth\": 3.3, \"petalLength\": 1.7000000000000002, \"petalWidth\": 0.5, \"species\": \"setosa\"}, {\"sepalLength\": 4.8, \"sepalWidth\": 3.4, \"petalLength\": 1.9, \"petalWidth\": 0.2, \"species\": \"setosa\"}, {\"sepalLength\": 5.0, \"sepalWidth\": 3.0, \"petalLength\": 1.6, \"petalWidth\": 0.2, \"species\": \"setosa\"}, {\"sepalLength\": 5.0, \"sepalWidth\": 3.4, \"petalLength\": 1.6, \"petalWidth\": 0.4, \"species\": \"setosa\"}, {\"sepalLength\": 5.2, \"sepalWidth\": 3.5, \"petalLength\": 1.5, \"petalWidth\": 0.2, \"species\": \"setosa\"}, {\"sepalLength\": 5.2, \"sepalWidth\": 3.4, \"petalLength\": 1.4, \"petalWidth\": 0.2, \"species\": \"setosa\"}, {\"sepalLength\": 4.7, \"sepalWidth\": 3.2, \"petalLength\": 1.6, \"petalWidth\": 0.2, \"species\": \"setosa\"}, {\"sepalLength\": 4.8, \"sepalWidth\": 3.1, \"petalLength\": 1.6, \"petalWidth\": 0.2, \"species\": \"setosa\"}, {\"sepalLength\": 5.4, \"sepalWidth\": 3.4, \"petalLength\": 1.5, \"petalWidth\": 0.4, \"species\": \"setosa\"}, {\"sepalLength\": 5.2, \"sepalWidth\": 4.1, \"petalLength\": 1.5, \"petalWidth\": 0.1, \"species\": \"setosa\"}, {\"sepalLength\": 5.5, \"sepalWidth\": 4.2, \"petalLength\": 1.4, \"petalWidth\": 0.2, \"species\": \"setosa\"}, {\"sepalLength\": 4.9, \"sepalWidth\": 3.1, \"petalLength\": 1.5, \"petalWidth\": 0.2, \"species\": \"setosa\"}, {\"sepalLength\": 5.0, \"sepalWidth\": 3.2, \"petalLength\": 1.2, \"petalWidth\": 0.2, \"species\": \"setosa\"}, {\"sepalLength\": 5.5, \"sepalWidth\": 3.5, \"petalLength\": 1.3, \"petalWidth\": 0.2, \"species\": \"setosa\"}, {\"sepalLength\": 4.9, \"sepalWidth\": 3.6, \"petalLength\": 1.4, \"petalWidth\": 0.1, \"species\": \"setosa\"}, {\"sepalLength\": 4.4, \"sepalWidth\": 3.0, \"petalLength\": 1.3, \"petalWidth\": 0.2, \"species\": \"setosa\"}, {\"sepalLength\": 5.1, \"sepalWidth\": 3.4, \"petalLength\": 1.5, \"petalWidth\": 0.2, \"species\": \"setosa\"}, {\"sepalLength\": 5.0, \"sepalWidth\": 3.5, \"petalLength\": 1.3, \"petalWidth\": 0.30000000000000004, \"species\": \"setosa\"}, {\"sepalLength\": 4.5, \"sepalWidth\": 2.3, \"petalLength\": 1.3, \"petalWidth\": 0.30000000000000004, \"species\": \"setosa\"}, {\"sepalLength\": 4.4, \"sepalWidth\": 3.2, \"petalLength\": 1.3, \"petalWidth\": 0.2, \"species\": \"setosa\"}, {\"sepalLength\": 5.0, \"sepalWidth\": 3.5, \"petalLength\": 1.6, \"petalWidth\": 0.6000000000000001, \"species\": \"setosa\"}, {\"sepalLength\": 5.1, \"sepalWidth\": 3.8, \"petalLength\": 1.9, \"petalWidth\": 0.4, \"species\": \"setosa\"}, {\"sepalLength\": 4.8, \"sepalWidth\": 3.0, \"petalLength\": 1.4, \"petalWidth\": 0.30000000000000004, \"species\": \"setosa\"}, {\"sepalLength\": 5.1, \"sepalWidth\": 3.8, \"petalLength\": 1.6, \"petalWidth\": 0.2, \"species\": \"setosa\"}, {\"sepalLength\": 4.6, \"sepalWidth\": 3.2, \"petalLength\": 1.4, \"petalWidth\": 0.2, \"species\": \"setosa\"}, {\"sepalLength\": 5.3, \"sepalWidth\": 3.7, \"petalLength\": 1.5, \"petalWidth\": 0.2, \"species\": \"setosa\"}, {\"sepalLength\": 5.0, \"sepalWidth\": 3.3, \"petalLength\": 1.4, \"petalWidth\": 0.2, \"species\": \"setosa\"}, {\"sepalLength\": 7.0, \"sepalWidth\": 3.2, \"petalLength\": 4.7, \"petalWidth\": 1.4, \"species\": \"versicolor\"}, {\"sepalLength\": 6.4, \"sepalWidth\": 3.2, \"petalLength\": 4.5, \"petalWidth\": 1.5, \"species\": \"versicolor\"}, {\"sepalLength\": 6.9, \"sepalWidth\": 3.1, \"petalLength\": 4.9, \"petalWidth\": 1.5, \"species\": \"versicolor\"}, {\"sepalLength\": 5.5, \"sepalWidth\": 2.3, \"petalLength\": 4.0, \"petalWidth\": 1.3, \"species\": \"versicolor\"}, {\"sepalLength\": 6.5, \"sepalWidth\": 2.8, \"petalLength\": 4.6, \"petalWidth\": 1.5, \"species\": \"versicolor\"}, {\"sepalLength\": 5.7, \"sepalWidth\": 2.8, \"petalLength\": 4.5, \"petalWidth\": 1.3, \"species\": \"versicolor\"}, {\"sepalLength\": 6.3, \"sepalWidth\": 3.3, \"petalLength\": 4.7, \"petalWidth\": 1.6, \"species\": \"versicolor\"}, {\"sepalLength\": 4.9, \"sepalWidth\": 2.4, \"petalLength\": 3.3, \"petalWidth\": 1.0, \"species\": \"versicolor\"}, {\"sepalLength\": 6.6, \"sepalWidth\": 2.9, \"petalLength\": 4.6, \"petalWidth\": 1.3, \"species\": \"versicolor\"}, {\"sepalLength\": 5.2, \"sepalWidth\": 2.7, \"petalLength\": 3.9, \"petalWidth\": 1.4, \"species\": \"versicolor\"}, {\"sepalLength\": 5.0, \"sepalWidth\": 2.0, \"petalLength\": 3.5, \"petalWidth\": 1.0, \"species\": \"versicolor\"}, {\"sepalLength\": 5.9, \"sepalWidth\": 3.0, \"petalLength\": 4.2, \"petalWidth\": 1.5, \"species\": \"versicolor\"}, {\"sepalLength\": 6.0, \"sepalWidth\": 2.2, \"petalLength\": 4.0, \"petalWidth\": 1.0, \"species\": \"versicolor\"}, {\"sepalLength\": 6.1, \"sepalWidth\": 2.9, \"petalLength\": 4.7, \"petalWidth\": 1.4, \"species\": \"versicolor\"}, {\"sepalLength\": 5.6, \"sepalWidth\": 2.9, \"petalLength\": 3.6, \"petalWidth\": 1.3, \"species\": \"versicolor\"}, {\"sepalLength\": 6.7, \"sepalWidth\": 3.1, \"petalLength\": 4.4, \"petalWidth\": 1.4, \"species\": \"versicolor\"}, {\"sepalLength\": 5.6, \"sepalWidth\": 3.0, \"petalLength\": 4.5, \"petalWidth\": 1.5, \"species\": \"versicolor\"}, {\"sepalLength\": 5.8, \"sepalWidth\": 2.7, \"petalLength\": 4.1, \"petalWidth\": 1.0, \"species\": \"versicolor\"}, {\"sepalLength\": 6.2, \"sepalWidth\": 2.2, \"petalLength\": 4.5, \"petalWidth\": 1.5, \"species\": \"versicolor\"}, {\"sepalLength\": 5.6, \"sepalWidth\": 2.5, \"petalLength\": 3.9, \"petalWidth\": 1.1, \"species\": \"versicolor\"}, {\"sepalLength\": 5.9, \"sepalWidth\": 3.2, \"petalLength\": 4.8, \"petalWidth\": 1.8, \"species\": \"versicolor\"}, {\"sepalLength\": 6.1, \"sepalWidth\": 2.8, \"petalLength\": 4.0, \"petalWidth\": 1.3, \"species\": \"versicolor\"}, {\"sepalLength\": 6.3, \"sepalWidth\": 2.5, \"petalLength\": 4.9, \"petalWidth\": 1.5, \"species\": \"versicolor\"}, {\"sepalLength\": 6.1, \"sepalWidth\": 2.8, \"petalLength\": 4.7, \"petalWidth\": 1.2, \"species\": \"versicolor\"}, {\"sepalLength\": 6.4, \"sepalWidth\": 2.9, \"petalLength\": 4.3, \"petalWidth\": 1.3, \"species\": \"versicolor\"}, {\"sepalLength\": 6.6, \"sepalWidth\": 3.0, \"petalLength\": 4.4, \"petalWidth\": 1.4, \"species\": \"versicolor\"}, {\"sepalLength\": 6.8, \"sepalWidth\": 2.8, \"petalLength\": 4.8, \"petalWidth\": 1.4, \"species\": \"versicolor\"}, {\"sepalLength\": 6.7, \"sepalWidth\": 3.0, \"petalLength\": 5.0, \"petalWidth\": 1.7000000000000002, \"species\": \"versicolor\"}, {\"sepalLength\": 6.0, \"sepalWidth\": 2.9, \"petalLength\": 4.5, \"petalWidth\": 1.5, \"species\": \"versicolor\"}, {\"sepalLength\": 5.7, \"sepalWidth\": 2.6, \"petalLength\": 3.5, \"petalWidth\": 1.0, \"species\": \"versicolor\"}, {\"sepalLength\": 5.5, \"sepalWidth\": 2.4, \"petalLength\": 3.8, \"petalWidth\": 1.1, \"species\": \"versicolor\"}, {\"sepalLength\": 5.5, \"sepalWidth\": 2.4, \"petalLength\": 3.7, \"petalWidth\": 1.0, \"species\": \"versicolor\"}, {\"sepalLength\": 5.8, \"sepalWidth\": 2.7, \"petalLength\": 3.9, \"petalWidth\": 1.2, \"species\": \"versicolor\"}, {\"sepalLength\": 6.0, \"sepalWidth\": 2.7, \"petalLength\": 5.1, \"petalWidth\": 1.6, \"species\": \"versicolor\"}, {\"sepalLength\": 5.4, \"sepalWidth\": 3.0, \"petalLength\": 4.5, \"petalWidth\": 1.5, \"species\": \"versicolor\"}, {\"sepalLength\": 6.0, \"sepalWidth\": 3.4, \"petalLength\": 4.5, \"petalWidth\": 1.6, \"species\": \"versicolor\"}, {\"sepalLength\": 6.7, \"sepalWidth\": 3.1, \"petalLength\": 4.7, \"petalWidth\": 1.5, \"species\": \"versicolor\"}, {\"sepalLength\": 6.3, \"sepalWidth\": 2.3, \"petalLength\": 4.4, \"petalWidth\": 1.3, \"species\": \"versicolor\"}, {\"sepalLength\": 5.6, \"sepalWidth\": 3.0, \"petalLength\": 4.1, \"petalWidth\": 1.3, \"species\": \"versicolor\"}, {\"sepalLength\": 5.5, \"sepalWidth\": 2.5, \"petalLength\": 4.0, \"petalWidth\": 1.3, \"species\": \"versicolor\"}, {\"sepalLength\": 5.5, \"sepalWidth\": 2.6, \"petalLength\": 4.4, \"petalWidth\": 1.2, \"species\": \"versicolor\"}, {\"sepalLength\": 6.1, \"sepalWidth\": 3.0, \"petalLength\": 4.6, \"petalWidth\": 1.4, \"species\": \"versicolor\"}, {\"sepalLength\": 5.8, \"sepalWidth\": 2.6, \"petalLength\": 4.0, \"petalWidth\": 1.2, \"species\": \"versicolor\"}, {\"sepalLength\": 5.0, \"sepalWidth\": 2.3, \"petalLength\": 3.3, \"petalWidth\": 1.0, \"species\": \"versicolor\"}, {\"sepalLength\": 5.6, \"sepalWidth\": 2.7, \"petalLength\": 4.2, \"petalWidth\": 1.3, \"species\": \"versicolor\"}, {\"sepalLength\": 5.7, \"sepalWidth\": 3.0, \"petalLength\": 4.2, \"petalWidth\": 1.2, \"species\": \"versicolor\"}, {\"sepalLength\": 5.7, \"sepalWidth\": 2.9, \"petalLength\": 4.2, \"petalWidth\": 1.3, \"species\": \"versicolor\"}, {\"sepalLength\": 6.2, \"sepalWidth\": 2.9, \"petalLength\": 4.3, \"petalWidth\": 1.3, \"species\": \"versicolor\"}, {\"sepalLength\": 5.1, \"sepalWidth\": 2.5, \"petalLength\": 3.0, \"petalWidth\": 1.1, \"species\": \"versicolor\"}, {\"sepalLength\": 5.7, \"sepalWidth\": 2.8, \"petalLength\": 4.1, \"petalWidth\": 1.3, \"species\": \"versicolor\"}, {\"sepalLength\": 6.3, \"sepalWidth\": 3.3, \"petalLength\": 6.0, \"petalWidth\": 2.5, \"species\": \"virginica\"}, {\"sepalLength\": 5.8, \"sepalWidth\": 2.7, \"petalLength\": 5.1, \"petalWidth\": 1.9, \"species\": \"virginica\"}, {\"sepalLength\": 7.1, \"sepalWidth\": 3.0, \"petalLength\": 5.9, \"petalWidth\": 2.1, \"species\": \"virginica\"}, {\"sepalLength\": 6.3, \"sepalWidth\": 2.9, \"petalLength\": 5.6, \"petalWidth\": 1.8, \"species\": \"virginica\"}, {\"sepalLength\": 6.5, \"sepalWidth\": 3.0, \"petalLength\": 5.8, \"petalWidth\": 2.2, \"species\": \"virginica\"}, {\"sepalLength\": 7.6, \"sepalWidth\": 3.0, \"petalLength\": 6.6, \"petalWidth\": 2.1, \"species\": \"virginica\"}, {\"sepalLength\": 4.9, \"sepalWidth\": 2.5, \"petalLength\": 4.5, \"petalWidth\": 1.7000000000000002, \"species\": \"virginica\"}, {\"sepalLength\": 7.3, \"sepalWidth\": 2.9, \"petalLength\": 6.3, \"petalWidth\": 1.8, \"species\": \"virginica\"}, {\"sepalLength\": 6.7, \"sepalWidth\": 2.5, \"petalLength\": 5.8, \"petalWidth\": 1.8, \"species\": \"virginica\"}, {\"sepalLength\": 7.2, \"sepalWidth\": 3.6, \"petalLength\": 6.1, \"petalWidth\": 2.5, \"species\": \"virginica\"}, {\"sepalLength\": 6.5, \"sepalWidth\": 3.2, \"petalLength\": 5.1, \"petalWidth\": 2.0, \"species\": \"virginica\"}, {\"sepalLength\": 6.4, \"sepalWidth\": 2.7, \"petalLength\": 5.3, \"petalWidth\": 1.9, \"species\": \"virginica\"}, {\"sepalLength\": 6.8, \"sepalWidth\": 3.0, \"petalLength\": 5.5, \"petalWidth\": 2.1, \"species\": \"virginica\"}, {\"sepalLength\": 5.7, \"sepalWidth\": 2.5, \"petalLength\": 5.0, \"petalWidth\": 2.0, \"species\": \"virginica\"}, {\"sepalLength\": 5.8, \"sepalWidth\": 2.8, \"petalLength\": 5.1, \"petalWidth\": 2.4, \"species\": \"virginica\"}, {\"sepalLength\": 6.4, \"sepalWidth\": 3.2, \"petalLength\": 5.3, \"petalWidth\": 2.3, \"species\": \"virginica\"}, {\"sepalLength\": 6.5, \"sepalWidth\": 3.0, \"petalLength\": 5.5, \"petalWidth\": 1.8, \"species\": \"virginica\"}, {\"sepalLength\": 7.7, \"sepalWidth\": 3.8, \"petalLength\": 6.7, \"petalWidth\": 2.2, \"species\": \"virginica\"}, {\"sepalLength\": 7.7, \"sepalWidth\": 2.6, \"petalLength\": 6.9, \"petalWidth\": 2.3, \"species\": \"virginica\"}, {\"sepalLength\": 6.0, \"sepalWidth\": 2.2, \"petalLength\": 5.0, \"petalWidth\": 1.5, \"species\": \"virginica\"}, {\"sepalLength\": 6.9, \"sepalWidth\": 3.2, \"petalLength\": 5.7, \"petalWidth\": 2.3, \"species\": \"virginica\"}, {\"sepalLength\": 5.6, \"sepalWidth\": 2.8, \"petalLength\": 4.9, \"petalWidth\": 2.0, \"species\": \"virginica\"}, {\"sepalLength\": 7.7, \"sepalWidth\": 2.8, \"petalLength\": 6.7, \"petalWidth\": 2.0, \"species\": \"virginica\"}, {\"sepalLength\": 6.3, \"sepalWidth\": 2.7, \"petalLength\": 4.9, \"petalWidth\": 1.8, \"species\": \"virginica\"}, {\"sepalLength\": 6.7, \"sepalWidth\": 3.3, \"petalLength\": 5.7, \"petalWidth\": 2.1, \"species\": \"virginica\"}, {\"sepalLength\": 7.2, \"sepalWidth\": 3.2, \"petalLength\": 6.0, \"petalWidth\": 1.8, \"species\": \"virginica\"}, {\"sepalLength\": 6.2, \"sepalWidth\": 2.8, \"petalLength\": 4.8, \"petalWidth\": 1.8, \"species\": \"virginica\"}, {\"sepalLength\": 6.1, \"sepalWidth\": 3.0, \"petalLength\": 4.9, \"petalWidth\": 1.8, \"species\": \"virginica\"}, {\"sepalLength\": 6.4, \"sepalWidth\": 2.8, \"petalLength\": 5.6, \"petalWidth\": 2.1, \"species\": \"virginica\"}, {\"sepalLength\": 7.2, \"sepalWidth\": 3.0, \"petalLength\": 5.8, \"petalWidth\": 1.6, \"species\": \"virginica\"}, {\"sepalLength\": 7.4, \"sepalWidth\": 2.8, \"petalLength\": 6.1, \"petalWidth\": 1.9, \"species\": \"virginica\"}, {\"sepalLength\": 7.9, \"sepalWidth\": 3.8, \"petalLength\": 6.4, \"petalWidth\": 2.0, \"species\": \"virginica\"}, {\"sepalLength\": 6.4, \"sepalWidth\": 2.8, \"petalLength\": 5.6, \"petalWidth\": 2.2, \"species\": \"virginica\"}, {\"sepalLength\": 6.3, \"sepalWidth\": 2.8, \"petalLength\": 5.1, \"petalWidth\": 1.5, \"species\": \"virginica\"}, {\"sepalLength\": 6.1, \"sepalWidth\": 2.6, \"petalLength\": 5.6, \"petalWidth\": 1.4, \"species\": \"virginica\"}, {\"sepalLength\": 7.7, \"sepalWidth\": 3.0, \"petalLength\": 6.1, \"petalWidth\": 2.3, \"species\": \"virginica\"}, {\"sepalLength\": 6.3, \"sepalWidth\": 3.4, \"petalLength\": 5.6, \"petalWidth\": 2.4, \"species\": \"virginica\"}, {\"sepalLength\": 6.4, \"sepalWidth\": 3.1, \"petalLength\": 5.5, \"petalWidth\": 1.8, \"species\": \"virginica\"}, {\"sepalLength\": 6.0, \"sepalWidth\": 3.0, \"petalLength\": 4.8, \"petalWidth\": 1.8, \"species\": \"virginica\"}, {\"sepalLength\": 6.9, \"sepalWidth\": 3.1, \"petalLength\": 5.4, \"petalWidth\": 2.1, \"species\": \"virginica\"}, {\"sepalLength\": 6.7, \"sepalWidth\": 3.1, \"petalLength\": 5.6, \"petalWidth\": 2.4, \"species\": \"virginica\"}, {\"sepalLength\": 6.9, \"sepalWidth\": 3.1, \"petalLength\": 5.1, \"petalWidth\": 2.3, \"species\": \"virginica\"}, {\"sepalLength\": 5.8, \"sepalWidth\": 2.7, \"petalLength\": 5.1, \"petalWidth\": 1.9, \"species\": \"virginica\"}, {\"sepalLength\": 6.8, \"sepalWidth\": 3.2, \"petalLength\": 5.9, \"petalWidth\": 2.3, \"species\": \"virginica\"}, {\"sepalLength\": 6.7, \"sepalWidth\": 3.3, \"petalLength\": 5.7, \"petalWidth\": 2.5, \"species\": \"virginica\"}, {\"sepalLength\": 6.7, \"sepalWidth\": 3.0, \"petalLength\": 5.2, \"petalWidth\": 2.3, \"species\": \"virginica\"}, {\"sepalLength\": 6.3, \"sepalWidth\": 2.5, \"petalLength\": 5.0, \"petalWidth\": 1.9, \"species\": \"virginica\"}, {\"sepalLength\": 6.5, \"sepalWidth\": 3.0, \"petalLength\": 5.2, \"petalWidth\": 2.0, \"species\": \"virginica\"}, {\"sepalLength\": 6.2, \"sepalWidth\": 3.4, \"petalLength\": 5.4, \"petalWidth\": 2.3, \"species\": \"virginica\"}, {\"sepalLength\": 5.9, \"sepalWidth\": 3.0, \"petalLength\": 5.1, \"petalWidth\": 1.8, \"species\": \"virginica\"}]}}, {\"mode\": \"vega-lite\"});\n",
       "</script>"
      ],
      "text/plain": [
       "alt.Chart(...)"
      ]
     },
     "execution_count": 155,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "alt.Chart(iris).mark_bar().encode(\n",
    "    alt.X('sepalWidth:Q', bin=alt.BinParams(maxbins=20)),\n",
    "    alt.Y('count()')\n",
    ")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "\n",
       "<div id=\"altair-viz-bfc0388b055841a5a2b5bfa14b066d09\"></div>\n",
       "<script type=\"text/javascript\">\n",
       "  (function(spec, embedOpt){\n",
       "    const outputDiv = document.getElementById(\"altair-viz-bfc0388b055841a5a2b5bfa14b066d09\");\n",
       "    const paths = {\n",
       "      \"vega\": \"https://cdn.jsdelivr.net/npm//vega@5?noext\",\n",
       "      \"vega-lib\": \"https://cdn.jsdelivr.net/npm//vega-lib?noext\",\n",
       "      \"vega-lite\": \"https://cdn.jsdelivr.net/npm//vega-lite@4.0.2?noext\",\n",
       "      \"vega-embed\": \"https://cdn.jsdelivr.net/npm//vega-embed@6?noext\",\n",
       "    };\n",
       "\n",
       "    function loadScript(lib) {\n",
       "      return new Promise(function(resolve, reject) {\n",
       "        var s = document.createElement('script');\n",
       "        s.src = paths[lib];\n",
       "        s.async = true;\n",
       "        s.onload = () => resolve(paths[lib]);\n",
       "        s.onerror = () => reject(`Error loading script: ${paths[lib]}`);\n",
       "        document.getElementsByTagName(\"head\")[0].appendChild(s);\n",
       "      });\n",
       "    }\n",
       "\n",
       "    function showError(err) {\n",
       "      outputDiv.innerHTML = `<div class=\"error\" style=\"color:red;\">${err}</div>`;\n",
       "      throw err;\n",
       "    }\n",
       "\n",
       "    function displayChart(vegaEmbed) {\n",
       "      vegaEmbed(outputDiv, spec, embedOpt)\n",
       "        .catch(err => showError(`Javascript Error: ${err.message}<br>This usually means there's a typo in your chart specification. See the javascript console for the full traceback.`));\n",
       "    }\n",
       "\n",
       "    if(typeof define === \"function\" && define.amd) {\n",
       "      requirejs.config({paths});\n",
       "      require([\"vega-embed\"], displayChart, err => showError(`Error loading script: ${err.message}`));\n",
       "    } else if (typeof vegaEmbed === \"function\") {\n",
       "      displayChart(vegaEmbed);\n",
       "    } else {\n",
       "      loadScript(\"vega\")\n",
       "        .then(() => loadScript(\"vega-lite\"))\n",
       "        .then(() => loadScript(\"vega-embed\"))\n",
       "        .catch(showError)\n",
       "        .then(() => displayChart(vegaEmbed));\n",
       "    }\n",
       "  })({\"config\": {\"view\": {\"continuousWidth\": 400, \"continuousHeight\": 300}}, \"data\": {\"name\": \"data-a264acbd6e539a8b3afc0cb5f240fb57\"}, \"mark\": {\"type\": \"boxplot\", \"color\": \"#1EAFAE\"}, \"encoding\": {\"x\": {\"type\": \"nominal\", \"field\": \"species\"}, \"y\": {\"type\": \"quantitative\", \"field\": \"petalLength\"}}, \"width\": 400, \"$schema\": \"https://vega.github.io/schema/vega-lite/v4.0.2.json\", \"datasets\": {\"data-a264acbd6e539a8b3afc0cb5f240fb57\": [{\"sepalLength\": 5.1, \"sepalWidth\": 3.5, \"petalLength\": 1.4, \"petalWidth\": 0.2, \"species\": \"setosa\"}, {\"sepalLength\": 4.9, \"sepalWidth\": 3.0, \"petalLength\": 1.4, \"petalWidth\": 0.2, \"species\": \"setosa\"}, {\"sepalLength\": 4.7, \"sepalWidth\": 3.2, \"petalLength\": 1.3, \"petalWidth\": 0.2, \"species\": \"setosa\"}, {\"sepalLength\": 4.6, \"sepalWidth\": 3.1, \"petalLength\": 1.5, \"petalWidth\": 0.2, \"species\": \"setosa\"}, {\"sepalLength\": 5.0, \"sepalWidth\": 3.6, \"petalLength\": 1.4, \"petalWidth\": 0.2, \"species\": \"setosa\"}, {\"sepalLength\": 5.4, \"sepalWidth\": 3.9, \"petalLength\": 1.7000000000000002, \"petalWidth\": 0.4, \"species\": \"setosa\"}, {\"sepalLength\": 4.6, \"sepalWidth\": 3.4, \"petalLength\": 1.4, \"petalWidth\": 0.30000000000000004, \"species\": \"setosa\"}, {\"sepalLength\": 5.0, \"sepalWidth\": 3.4, \"petalLength\": 1.5, \"petalWidth\": 0.2, \"species\": \"setosa\"}, {\"sepalLength\": 4.4, \"sepalWidth\": 2.9, \"petalLength\": 1.4, \"petalWidth\": 0.2, \"species\": \"setosa\"}, {\"sepalLength\": 4.9, \"sepalWidth\": 3.1, \"petalLength\": 1.5, \"petalWidth\": 0.1, \"species\": \"setosa\"}, {\"sepalLength\": 5.4, \"sepalWidth\": 3.7, \"petalLength\": 1.5, \"petalWidth\": 0.2, \"species\": \"setosa\"}, {\"sepalLength\": 4.8, \"sepalWidth\": 3.4, \"petalLength\": 1.6, \"petalWidth\": 0.2, \"species\": \"setosa\"}, {\"sepalLength\": 4.8, \"sepalWidth\": 3.0, \"petalLength\": 1.4, \"petalWidth\": 0.1, \"species\": \"setosa\"}, {\"sepalLength\": 4.3, \"sepalWidth\": 3.0, \"petalLength\": 1.1, \"petalWidth\": 0.1, \"species\": \"setosa\"}, {\"sepalLength\": 5.8, \"sepalWidth\": 4.0, \"petalLength\": 1.2, \"petalWidth\": 0.2, \"species\": \"setosa\"}, {\"sepalLength\": 5.7, \"sepalWidth\": 4.4, \"petalLength\": 1.5, \"petalWidth\": 0.4, \"species\": \"setosa\"}, {\"sepalLength\": 5.4, \"sepalWidth\": 3.9, \"petalLength\": 1.3, \"petalWidth\": 0.4, \"species\": \"setosa\"}, {\"sepalLength\": 5.1, \"sepalWidth\": 3.5, \"petalLength\": 1.4, \"petalWidth\": 0.30000000000000004, \"species\": \"setosa\"}, {\"sepalLength\": 5.7, \"sepalWidth\": 3.8, \"petalLength\": 1.7000000000000002, \"petalWidth\": 0.30000000000000004, \"species\": \"setosa\"}, {\"sepalLength\": 5.1, \"sepalWidth\": 3.8, \"petalLength\": 1.5, \"petalWidth\": 0.30000000000000004, \"species\": \"setosa\"}, {\"sepalLength\": 5.4, \"sepalWidth\": 3.4, \"petalLength\": 1.7000000000000002, \"petalWidth\": 0.2, \"species\": \"setosa\"}, {\"sepalLength\": 5.1, \"sepalWidth\": 3.7, \"petalLength\": 1.5, \"petalWidth\": 0.4, \"species\": \"setosa\"}, {\"sepalLength\": 4.6, \"sepalWidth\": 3.6, \"petalLength\": 1.0, \"petalWidth\": 0.2, \"species\": \"setosa\"}, {\"sepalLength\": 5.1, \"sepalWidth\": 3.3, \"petalLength\": 1.7000000000000002, \"petalWidth\": 0.5, \"species\": \"setosa\"}, {\"sepalLength\": 4.8, \"sepalWidth\": 3.4, \"petalLength\": 1.9, \"petalWidth\": 0.2, \"species\": \"setosa\"}, {\"sepalLength\": 5.0, \"sepalWidth\": 3.0, \"petalLength\": 1.6, \"petalWidth\": 0.2, \"species\": \"setosa\"}, {\"sepalLength\": 5.0, \"sepalWidth\": 3.4, \"petalLength\": 1.6, \"petalWidth\": 0.4, \"species\": \"setosa\"}, {\"sepalLength\": 5.2, \"sepalWidth\": 3.5, \"petalLength\": 1.5, \"petalWidth\": 0.2, \"species\": \"setosa\"}, {\"sepalLength\": 5.2, \"sepalWidth\": 3.4, \"petalLength\": 1.4, \"petalWidth\": 0.2, \"species\": \"setosa\"}, {\"sepalLength\": 4.7, \"sepalWidth\": 3.2, \"petalLength\": 1.6, \"petalWidth\": 0.2, \"species\": \"setosa\"}, {\"sepalLength\": 4.8, \"sepalWidth\": 3.1, \"petalLength\": 1.6, \"petalWidth\": 0.2, \"species\": \"setosa\"}, {\"sepalLength\": 5.4, \"sepalWidth\": 3.4, \"petalLength\": 1.5, \"petalWidth\": 0.4, \"species\": \"setosa\"}, {\"sepalLength\": 5.2, \"sepalWidth\": 4.1, \"petalLength\": 1.5, \"petalWidth\": 0.1, \"species\": \"setosa\"}, {\"sepalLength\": 5.5, \"sepalWidth\": 4.2, \"petalLength\": 1.4, \"petalWidth\": 0.2, \"species\": \"setosa\"}, {\"sepalLength\": 4.9, \"sepalWidth\": 3.1, \"petalLength\": 1.5, \"petalWidth\": 0.2, \"species\": \"setosa\"}, {\"sepalLength\": 5.0, \"sepalWidth\": 3.2, \"petalLength\": 1.2, \"petalWidth\": 0.2, \"species\": \"setosa\"}, {\"sepalLength\": 5.5, \"sepalWidth\": 3.5, \"petalLength\": 1.3, \"petalWidth\": 0.2, \"species\": \"setosa\"}, {\"sepalLength\": 4.9, \"sepalWidth\": 3.6, \"petalLength\": 1.4, \"petalWidth\": 0.1, \"species\": \"setosa\"}, {\"sepalLength\": 4.4, \"sepalWidth\": 3.0, \"petalLength\": 1.3, \"petalWidth\": 0.2, \"species\": \"setosa\"}, {\"sepalLength\": 5.1, \"sepalWidth\": 3.4, \"petalLength\": 1.5, \"petalWidth\": 0.2, \"species\": \"setosa\"}, {\"sepalLength\": 5.0, \"sepalWidth\": 3.5, \"petalLength\": 1.3, \"petalWidth\": 0.30000000000000004, \"species\": \"setosa\"}, {\"sepalLength\": 4.5, \"sepalWidth\": 2.3, \"petalLength\": 1.3, \"petalWidth\": 0.30000000000000004, \"species\": \"setosa\"}, {\"sepalLength\": 4.4, \"sepalWidth\": 3.2, \"petalLength\": 1.3, \"petalWidth\": 0.2, \"species\": \"setosa\"}, {\"sepalLength\": 5.0, \"sepalWidth\": 3.5, \"petalLength\": 1.6, \"petalWidth\": 0.6000000000000001, \"species\": \"setosa\"}, {\"sepalLength\": 5.1, \"sepalWidth\": 3.8, \"petalLength\": 1.9, \"petalWidth\": 0.4, \"species\": \"setosa\"}, {\"sepalLength\": 4.8, \"sepalWidth\": 3.0, \"petalLength\": 1.4, \"petalWidth\": 0.30000000000000004, \"species\": \"setosa\"}, {\"sepalLength\": 5.1, \"sepalWidth\": 3.8, \"petalLength\": 1.6, \"petalWidth\": 0.2, \"species\": \"setosa\"}, {\"sepalLength\": 4.6, \"sepalWidth\": 3.2, \"petalLength\": 1.4, \"petalWidth\": 0.2, \"species\": \"setosa\"}, {\"sepalLength\": 5.3, \"sepalWidth\": 3.7, \"petalLength\": 1.5, \"petalWidth\": 0.2, \"species\": \"setosa\"}, {\"sepalLength\": 5.0, \"sepalWidth\": 3.3, \"petalLength\": 1.4, \"petalWidth\": 0.2, \"species\": \"setosa\"}, {\"sepalLength\": 7.0, \"sepalWidth\": 3.2, \"petalLength\": 4.7, \"petalWidth\": 1.4, \"species\": \"versicolor\"}, {\"sepalLength\": 6.4, \"sepalWidth\": 3.2, \"petalLength\": 4.5, \"petalWidth\": 1.5, \"species\": \"versicolor\"}, {\"sepalLength\": 6.9, \"sepalWidth\": 3.1, \"petalLength\": 4.9, \"petalWidth\": 1.5, \"species\": \"versicolor\"}, {\"sepalLength\": 5.5, \"sepalWidth\": 2.3, \"petalLength\": 4.0, \"petalWidth\": 1.3, \"species\": \"versicolor\"}, {\"sepalLength\": 6.5, \"sepalWidth\": 2.8, \"petalLength\": 4.6, \"petalWidth\": 1.5, \"species\": \"versicolor\"}, {\"sepalLength\": 5.7, \"sepalWidth\": 2.8, \"petalLength\": 4.5, \"petalWidth\": 1.3, \"species\": \"versicolor\"}, {\"sepalLength\": 6.3, \"sepalWidth\": 3.3, \"petalLength\": 4.7, \"petalWidth\": 1.6, \"species\": \"versicolor\"}, {\"sepalLength\": 4.9, \"sepalWidth\": 2.4, \"petalLength\": 3.3, \"petalWidth\": 1.0, \"species\": \"versicolor\"}, {\"sepalLength\": 6.6, \"sepalWidth\": 2.9, \"petalLength\": 4.6, \"petalWidth\": 1.3, \"species\": \"versicolor\"}, {\"sepalLength\": 5.2, \"sepalWidth\": 2.7, \"petalLength\": 3.9, \"petalWidth\": 1.4, \"species\": \"versicolor\"}, {\"sepalLength\": 5.0, \"sepalWidth\": 2.0, \"petalLength\": 3.5, \"petalWidth\": 1.0, \"species\": \"versicolor\"}, {\"sepalLength\": 5.9, \"sepalWidth\": 3.0, \"petalLength\": 4.2, \"petalWidth\": 1.5, \"species\": \"versicolor\"}, {\"sepalLength\": 6.0, \"sepalWidth\": 2.2, \"petalLength\": 4.0, \"petalWidth\": 1.0, \"species\": \"versicolor\"}, {\"sepalLength\": 6.1, \"sepalWidth\": 2.9, \"petalLength\": 4.7, \"petalWidth\": 1.4, \"species\": \"versicolor\"}, {\"sepalLength\": 5.6, \"sepalWidth\": 2.9, \"petalLength\": 3.6, \"petalWidth\": 1.3, \"species\": \"versicolor\"}, {\"sepalLength\": 6.7, \"sepalWidth\": 3.1, \"petalLength\": 4.4, \"petalWidth\": 1.4, \"species\": \"versicolor\"}, {\"sepalLength\": 5.6, \"sepalWidth\": 3.0, \"petalLength\": 4.5, \"petalWidth\": 1.5, \"species\": \"versicolor\"}, {\"sepalLength\": 5.8, \"sepalWidth\": 2.7, \"petalLength\": 4.1, \"petalWidth\": 1.0, \"species\": \"versicolor\"}, {\"sepalLength\": 6.2, \"sepalWidth\": 2.2, \"petalLength\": 4.5, \"petalWidth\": 1.5, \"species\": \"versicolor\"}, {\"sepalLength\": 5.6, \"sepalWidth\": 2.5, \"petalLength\": 3.9, \"petalWidth\": 1.1, \"species\": \"versicolor\"}, {\"sepalLength\": 5.9, \"sepalWidth\": 3.2, \"petalLength\": 4.8, \"petalWidth\": 1.8, \"species\": \"versicolor\"}, {\"sepalLength\": 6.1, \"sepalWidth\": 2.8, \"petalLength\": 4.0, \"petalWidth\": 1.3, \"species\": \"versicolor\"}, {\"sepalLength\": 6.3, \"sepalWidth\": 2.5, \"petalLength\": 4.9, \"petalWidth\": 1.5, \"species\": \"versicolor\"}, {\"sepalLength\": 6.1, \"sepalWidth\": 2.8, \"petalLength\": 4.7, \"petalWidth\": 1.2, \"species\": \"versicolor\"}, {\"sepalLength\": 6.4, \"sepalWidth\": 2.9, \"petalLength\": 4.3, \"petalWidth\": 1.3, \"species\": \"versicolor\"}, {\"sepalLength\": 6.6, \"sepalWidth\": 3.0, \"petalLength\": 4.4, \"petalWidth\": 1.4, \"species\": \"versicolor\"}, {\"sepalLength\": 6.8, \"sepalWidth\": 2.8, \"petalLength\": 4.8, \"petalWidth\": 1.4, \"species\": \"versicolor\"}, {\"sepalLength\": 6.7, \"sepalWidth\": 3.0, \"petalLength\": 5.0, \"petalWidth\": 1.7000000000000002, \"species\": \"versicolor\"}, {\"sepalLength\": 6.0, \"sepalWidth\": 2.9, \"petalLength\": 4.5, \"petalWidth\": 1.5, \"species\": \"versicolor\"}, {\"sepalLength\": 5.7, \"sepalWidth\": 2.6, \"petalLength\": 3.5, \"petalWidth\": 1.0, \"species\": \"versicolor\"}, {\"sepalLength\": 5.5, \"sepalWidth\": 2.4, \"petalLength\": 3.8, \"petalWidth\": 1.1, \"species\": \"versicolor\"}, {\"sepalLength\": 5.5, \"sepalWidth\": 2.4, \"petalLength\": 3.7, \"petalWidth\": 1.0, \"species\": \"versicolor\"}, {\"sepalLength\": 5.8, \"sepalWidth\": 2.7, \"petalLength\": 3.9, \"petalWidth\": 1.2, \"species\": \"versicolor\"}, {\"sepalLength\": 6.0, \"sepalWidth\": 2.7, \"petalLength\": 5.1, \"petalWidth\": 1.6, \"species\": \"versicolor\"}, {\"sepalLength\": 5.4, \"sepalWidth\": 3.0, \"petalLength\": 4.5, \"petalWidth\": 1.5, \"species\": \"versicolor\"}, {\"sepalLength\": 6.0, \"sepalWidth\": 3.4, \"petalLength\": 4.5, \"petalWidth\": 1.6, \"species\": \"versicolor\"}, {\"sepalLength\": 6.7, \"sepalWidth\": 3.1, \"petalLength\": 4.7, \"petalWidth\": 1.5, \"species\": \"versicolor\"}, {\"sepalLength\": 6.3, \"sepalWidth\": 2.3, \"petalLength\": 4.4, \"petalWidth\": 1.3, \"species\": \"versicolor\"}, {\"sepalLength\": 5.6, \"sepalWidth\": 3.0, \"petalLength\": 4.1, \"petalWidth\": 1.3, \"species\": \"versicolor\"}, {\"sepalLength\": 5.5, \"sepalWidth\": 2.5, \"petalLength\": 4.0, \"petalWidth\": 1.3, \"species\": \"versicolor\"}, {\"sepalLength\": 5.5, \"sepalWidth\": 2.6, \"petalLength\": 4.4, \"petalWidth\": 1.2, \"species\": \"versicolor\"}, {\"sepalLength\": 6.1, \"sepalWidth\": 3.0, \"petalLength\": 4.6, \"petalWidth\": 1.4, \"species\": \"versicolor\"}, {\"sepalLength\": 5.8, \"sepalWidth\": 2.6, \"petalLength\": 4.0, \"petalWidth\": 1.2, \"species\": \"versicolor\"}, {\"sepalLength\": 5.0, \"sepalWidth\": 2.3, \"petalLength\": 3.3, \"petalWidth\": 1.0, \"species\": \"versicolor\"}, {\"sepalLength\": 5.6, \"sepalWidth\": 2.7, \"petalLength\": 4.2, \"petalWidth\": 1.3, \"species\": \"versicolor\"}, {\"sepalLength\": 5.7, \"sepalWidth\": 3.0, \"petalLength\": 4.2, \"petalWidth\": 1.2, \"species\": \"versicolor\"}, {\"sepalLength\": 5.7, \"sepalWidth\": 2.9, \"petalLength\": 4.2, \"petalWidth\": 1.3, \"species\": \"versicolor\"}, {\"sepalLength\": 6.2, \"sepalWidth\": 2.9, \"petalLength\": 4.3, \"petalWidth\": 1.3, \"species\": \"versicolor\"}, {\"sepalLength\": 5.1, \"sepalWidth\": 2.5, \"petalLength\": 3.0, \"petalWidth\": 1.1, \"species\": \"versicolor\"}, {\"sepalLength\": 5.7, \"sepalWidth\": 2.8, \"petalLength\": 4.1, \"petalWidth\": 1.3, \"species\": \"versicolor\"}, {\"sepalLength\": 6.3, \"sepalWidth\": 3.3, \"petalLength\": 6.0, \"petalWidth\": 2.5, \"species\": \"virginica\"}, {\"sepalLength\": 5.8, \"sepalWidth\": 2.7, \"petalLength\": 5.1, \"petalWidth\": 1.9, \"species\": \"virginica\"}, {\"sepalLength\": 7.1, \"sepalWidth\": 3.0, \"petalLength\": 5.9, \"petalWidth\": 2.1, \"species\": \"virginica\"}, {\"sepalLength\": 6.3, \"sepalWidth\": 2.9, \"petalLength\": 5.6, \"petalWidth\": 1.8, \"species\": \"virginica\"}, {\"sepalLength\": 6.5, \"sepalWidth\": 3.0, \"petalLength\": 5.8, \"petalWidth\": 2.2, \"species\": \"virginica\"}, {\"sepalLength\": 7.6, \"sepalWidth\": 3.0, \"petalLength\": 6.6, \"petalWidth\": 2.1, \"species\": \"virginica\"}, {\"sepalLength\": 4.9, \"sepalWidth\": 2.5, \"petalLength\": 4.5, \"petalWidth\": 1.7000000000000002, \"species\": \"virginica\"}, {\"sepalLength\": 7.3, \"sepalWidth\": 2.9, \"petalLength\": 6.3, \"petalWidth\": 1.8, \"species\": \"virginica\"}, {\"sepalLength\": 6.7, \"sepalWidth\": 2.5, \"petalLength\": 5.8, \"petalWidth\": 1.8, \"species\": \"virginica\"}, {\"sepalLength\": 7.2, \"sepalWidth\": 3.6, \"petalLength\": 6.1, \"petalWidth\": 2.5, \"species\": \"virginica\"}, {\"sepalLength\": 6.5, \"sepalWidth\": 3.2, \"petalLength\": 5.1, \"petalWidth\": 2.0, \"species\": \"virginica\"}, {\"sepalLength\": 6.4, \"sepalWidth\": 2.7, \"petalLength\": 5.3, \"petalWidth\": 1.9, \"species\": \"virginica\"}, {\"sepalLength\": 6.8, \"sepalWidth\": 3.0, \"petalLength\": 5.5, \"petalWidth\": 2.1, \"species\": \"virginica\"}, {\"sepalLength\": 5.7, \"sepalWidth\": 2.5, \"petalLength\": 5.0, \"petalWidth\": 2.0, \"species\": \"virginica\"}, {\"sepalLength\": 5.8, \"sepalWidth\": 2.8, \"petalLength\": 5.1, \"petalWidth\": 2.4, \"species\": \"virginica\"}, {\"sepalLength\": 6.4, \"sepalWidth\": 3.2, \"petalLength\": 5.3, \"petalWidth\": 2.3, \"species\": \"virginica\"}, {\"sepalLength\": 6.5, \"sepalWidth\": 3.0, \"petalLength\": 5.5, \"petalWidth\": 1.8, \"species\": \"virginica\"}, {\"sepalLength\": 7.7, \"sepalWidth\": 3.8, \"petalLength\": 6.7, \"petalWidth\": 2.2, \"species\": \"virginica\"}, {\"sepalLength\": 7.7, \"sepalWidth\": 2.6, \"petalLength\": 6.9, \"petalWidth\": 2.3, \"species\": \"virginica\"}, {\"sepalLength\": 6.0, \"sepalWidth\": 2.2, \"petalLength\": 5.0, \"petalWidth\": 1.5, \"species\": \"virginica\"}, {\"sepalLength\": 6.9, \"sepalWidth\": 3.2, \"petalLength\": 5.7, \"petalWidth\": 2.3, \"species\": \"virginica\"}, {\"sepalLength\": 5.6, \"sepalWidth\": 2.8, \"petalLength\": 4.9, \"petalWidth\": 2.0, \"species\": \"virginica\"}, {\"sepalLength\": 7.7, \"sepalWidth\": 2.8, \"petalLength\": 6.7, \"petalWidth\": 2.0, \"species\": \"virginica\"}, {\"sepalLength\": 6.3, \"sepalWidth\": 2.7, \"petalLength\": 4.9, \"petalWidth\": 1.8, \"species\": \"virginica\"}, {\"sepalLength\": 6.7, \"sepalWidth\": 3.3, \"petalLength\": 5.7, \"petalWidth\": 2.1, \"species\": \"virginica\"}, {\"sepalLength\": 7.2, \"sepalWidth\": 3.2, \"petalLength\": 6.0, \"petalWidth\": 1.8, \"species\": \"virginica\"}, {\"sepalLength\": 6.2, \"sepalWidth\": 2.8, \"petalLength\": 4.8, \"petalWidth\": 1.8, \"species\": \"virginica\"}, {\"sepalLength\": 6.1, \"sepalWidth\": 3.0, \"petalLength\": 4.9, \"petalWidth\": 1.8, \"species\": \"virginica\"}, {\"sepalLength\": 6.4, \"sepalWidth\": 2.8, \"petalLength\": 5.6, \"petalWidth\": 2.1, \"species\": \"virginica\"}, {\"sepalLength\": 7.2, \"sepalWidth\": 3.0, \"petalLength\": 5.8, \"petalWidth\": 1.6, \"species\": \"virginica\"}, {\"sepalLength\": 7.4, \"sepalWidth\": 2.8, \"petalLength\": 6.1, \"petalWidth\": 1.9, \"species\": \"virginica\"}, {\"sepalLength\": 7.9, \"sepalWidth\": 3.8, \"petalLength\": 6.4, \"petalWidth\": 2.0, \"species\": \"virginica\"}, {\"sepalLength\": 6.4, \"sepalWidth\": 2.8, \"petalLength\": 5.6, \"petalWidth\": 2.2, \"species\": \"virginica\"}, {\"sepalLength\": 6.3, \"sepalWidth\": 2.8, \"petalLength\": 5.1, \"petalWidth\": 1.5, \"species\": \"virginica\"}, {\"sepalLength\": 6.1, \"sepalWidth\": 2.6, \"petalLength\": 5.6, \"petalWidth\": 1.4, \"species\": \"virginica\"}, {\"sepalLength\": 7.7, \"sepalWidth\": 3.0, \"petalLength\": 6.1, \"petalWidth\": 2.3, \"species\": \"virginica\"}, {\"sepalLength\": 6.3, \"sepalWidth\": 3.4, \"petalLength\": 5.6, \"petalWidth\": 2.4, \"species\": \"virginica\"}, {\"sepalLength\": 6.4, \"sepalWidth\": 3.1, \"petalLength\": 5.5, \"petalWidth\": 1.8, \"species\": \"virginica\"}, {\"sepalLength\": 6.0, \"sepalWidth\": 3.0, \"petalLength\": 4.8, \"petalWidth\": 1.8, \"species\": \"virginica\"}, {\"sepalLength\": 6.9, \"sepalWidth\": 3.1, \"petalLength\": 5.4, \"petalWidth\": 2.1, \"species\": \"virginica\"}, {\"sepalLength\": 6.7, \"sepalWidth\": 3.1, \"petalLength\": 5.6, \"petalWidth\": 2.4, \"species\": \"virginica\"}, {\"sepalLength\": 6.9, \"sepalWidth\": 3.1, \"petalLength\": 5.1, \"petalWidth\": 2.3, \"species\": \"virginica\"}, {\"sepalLength\": 5.8, \"sepalWidth\": 2.7, \"petalLength\": 5.1, \"petalWidth\": 1.9, \"species\": \"virginica\"}, {\"sepalLength\": 6.8, \"sepalWidth\": 3.2, \"petalLength\": 5.9, \"petalWidth\": 2.3, \"species\": \"virginica\"}, {\"sepalLength\": 6.7, \"sepalWidth\": 3.3, \"petalLength\": 5.7, \"petalWidth\": 2.5, \"species\": \"virginica\"}, {\"sepalLength\": 6.7, \"sepalWidth\": 3.0, \"petalLength\": 5.2, \"petalWidth\": 2.3, \"species\": \"virginica\"}, {\"sepalLength\": 6.3, \"sepalWidth\": 2.5, \"petalLength\": 5.0, \"petalWidth\": 1.9, \"species\": \"virginica\"}, {\"sepalLength\": 6.5, \"sepalWidth\": 3.0, \"petalLength\": 5.2, \"petalWidth\": 2.0, \"species\": \"virginica\"}, {\"sepalLength\": 6.2, \"sepalWidth\": 3.4, \"petalLength\": 5.4, \"petalWidth\": 2.3, \"species\": \"virginica\"}, {\"sepalLength\": 5.9, \"sepalWidth\": 3.0, \"petalLength\": 5.1, \"petalWidth\": 1.8, \"species\": \"virginica\"}]}}, {\"mode\": \"vega-lite\"});\n",
       "</script>"
      ],
      "text/plain": [
       "alt.Chart(...)"
      ]
     },
     "execution_count": 23,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "alt.Chart(iris,width=400).mark_boxplot(color='#1EAFAE').encode(\n",
    "    x='species',\n",
    "    y='petalLength'\n",
    ")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 54,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "\n",
       "<div id=\"altair-viz-08557287fda543e798b4e6e868286587\"></div>\n",
       "<script type=\"text/javascript\">\n",
       "  (function(spec, embedOpt){\n",
       "    const outputDiv = document.getElementById(\"altair-viz-08557287fda543e798b4e6e868286587\");\n",
       "    const paths = {\n",
       "      \"vega\": \"https://cdn.jsdelivr.net/npm//vega@5?noext\",\n",
       "      \"vega-lib\": \"https://cdn.jsdelivr.net/npm//vega-lib?noext\",\n",
       "      \"vega-lite\": \"https://cdn.jsdelivr.net/npm//vega-lite@4.0.2?noext\",\n",
       "      \"vega-embed\": \"https://cdn.jsdelivr.net/npm//vega-embed@6?noext\",\n",
       "    };\n",
       "\n",
       "    function loadScript(lib) {\n",
       "      return new Promise(function(resolve, reject) {\n",
       "        var s = document.createElement('script');\n",
       "        s.src = paths[lib];\n",
       "        s.async = true;\n",
       "        s.onload = () => resolve(paths[lib]);\n",
       "        s.onerror = () => reject(`Error loading script: ${paths[lib]}`);\n",
       "        document.getElementsByTagName(\"head\")[0].appendChild(s);\n",
       "      });\n",
       "    }\n",
       "\n",
       "    function showError(err) {\n",
       "      outputDiv.innerHTML = `<div class=\"error\" style=\"color:red;\">${err}</div>`;\n",
       "      throw err;\n",
       "    }\n",
       "\n",
       "    function displayChart(vegaEmbed) {\n",
       "      vegaEmbed(outputDiv, spec, embedOpt)\n",
       "        .catch(err => showError(`Javascript Error: ${err.message}<br>This usually means there's a typo in your chart specification. See the javascript console for the full traceback.`));\n",
       "    }\n",
       "\n",
       "    if(typeof define === \"function\" && define.amd) {\n",
       "      requirejs.config({paths});\n",
       "      require([\"vega-embed\"], displayChart, err => showError(`Error loading script: ${err.message}`));\n",
       "    } else if (typeof vegaEmbed === \"function\") {\n",
       "      displayChart(vegaEmbed);\n",
       "    } else {\n",
       "      loadScript(\"vega\")\n",
       "        .then(() => loadScript(\"vega-lite\"))\n",
       "        .then(() => loadScript(\"vega-embed\"))\n",
       "        .catch(showError)\n",
       "        .then(() => displayChart(vegaEmbed));\n",
       "    }\n",
       "  })({\"config\": {\"view\": {\"continuousWidth\": 400, \"continuousHeight\": 300}}, \"hconcat\": [{\"mark\": {\"type\": \"bar\", \"color\": \"#1EAFAE\"}, \"encoding\": {\"x\": {\"type\": \"quantitative\", \"bin\": {\"maxbins\": 20}, \"field\": \"sepalWidth\"}, \"y\": {\"type\": \"quantitative\", \"aggregate\": \"count\"}}, \"width\": 300}, {\"mark\": {\"type\": \"boxplot\", \"color\": \"#1EAFAE\"}, \"encoding\": {\"x\": {\"type\": \"nominal\", \"field\": \"species\"}, \"y\": {\"type\": \"quantitative\", \"field\": \"petalLength\"}}, \"width\": 300}], \"data\": {\"name\": \"data-a264acbd6e539a8b3afc0cb5f240fb57\"}, \"$schema\": \"https://vega.github.io/schema/vega-lite/v4.0.2.json\", \"datasets\": {\"data-a264acbd6e539a8b3afc0cb5f240fb57\": [{\"sepalLength\": 5.1, \"sepalWidth\": 3.5, \"petalLength\": 1.4, \"petalWidth\": 0.2, \"species\": \"setosa\"}, {\"sepalLength\": 4.9, \"sepalWidth\": 3.0, \"petalLength\": 1.4, \"petalWidth\": 0.2, \"species\": \"setosa\"}, {\"sepalLength\": 4.7, \"sepalWidth\": 3.2, \"petalLength\": 1.3, \"petalWidth\": 0.2, \"species\": \"setosa\"}, {\"sepalLength\": 4.6, \"sepalWidth\": 3.1, \"petalLength\": 1.5, \"petalWidth\": 0.2, \"species\": \"setosa\"}, {\"sepalLength\": 5.0, \"sepalWidth\": 3.6, \"petalLength\": 1.4, \"petalWidth\": 0.2, \"species\": \"setosa\"}, {\"sepalLength\": 5.4, \"sepalWidth\": 3.9, \"petalLength\": 1.7000000000000002, \"petalWidth\": 0.4, \"species\": \"setosa\"}, {\"sepalLength\": 4.6, \"sepalWidth\": 3.4, \"petalLength\": 1.4, \"petalWidth\": 0.30000000000000004, \"species\": \"setosa\"}, {\"sepalLength\": 5.0, \"sepalWidth\": 3.4, \"petalLength\": 1.5, \"petalWidth\": 0.2, \"species\": \"setosa\"}, {\"sepalLength\": 4.4, \"sepalWidth\": 2.9, \"petalLength\": 1.4, \"petalWidth\": 0.2, \"species\": \"setosa\"}, {\"sepalLength\": 4.9, \"sepalWidth\": 3.1, \"petalLength\": 1.5, \"petalWidth\": 0.1, \"species\": \"setosa\"}, {\"sepalLength\": 5.4, \"sepalWidth\": 3.7, \"petalLength\": 1.5, \"petalWidth\": 0.2, \"species\": \"setosa\"}, {\"sepalLength\": 4.8, \"sepalWidth\": 3.4, \"petalLength\": 1.6, \"petalWidth\": 0.2, \"species\": \"setosa\"}, {\"sepalLength\": 4.8, \"sepalWidth\": 3.0, \"petalLength\": 1.4, \"petalWidth\": 0.1, \"species\": \"setosa\"}, {\"sepalLength\": 4.3, \"sepalWidth\": 3.0, \"petalLength\": 1.1, \"petalWidth\": 0.1, \"species\": \"setosa\"}, {\"sepalLength\": 5.8, \"sepalWidth\": 4.0, \"petalLength\": 1.2, \"petalWidth\": 0.2, \"species\": \"setosa\"}, {\"sepalLength\": 5.7, \"sepalWidth\": 4.4, \"petalLength\": 1.5, \"petalWidth\": 0.4, \"species\": \"setosa\"}, {\"sepalLength\": 5.4, \"sepalWidth\": 3.9, \"petalLength\": 1.3, \"petalWidth\": 0.4, \"species\": \"setosa\"}, {\"sepalLength\": 5.1, \"sepalWidth\": 3.5, \"petalLength\": 1.4, \"petalWidth\": 0.30000000000000004, \"species\": \"setosa\"}, {\"sepalLength\": 5.7, \"sepalWidth\": 3.8, \"petalLength\": 1.7000000000000002, \"petalWidth\": 0.30000000000000004, \"species\": \"setosa\"}, {\"sepalLength\": 5.1, \"sepalWidth\": 3.8, \"petalLength\": 1.5, \"petalWidth\": 0.30000000000000004, \"species\": \"setosa\"}, {\"sepalLength\": 5.4, \"sepalWidth\": 3.4, \"petalLength\": 1.7000000000000002, \"petalWidth\": 0.2, \"species\": \"setosa\"}, {\"sepalLength\": 5.1, \"sepalWidth\": 3.7, \"petalLength\": 1.5, \"petalWidth\": 0.4, \"species\": \"setosa\"}, {\"sepalLength\": 4.6, \"sepalWidth\": 3.6, \"petalLength\": 1.0, \"petalWidth\": 0.2, \"species\": \"setosa\"}, {\"sepalLength\": 5.1, \"sepalWidth\": 3.3, \"petalLength\": 1.7000000000000002, \"petalWidth\": 0.5, \"species\": \"setosa\"}, {\"sepalLength\": 4.8, \"sepalWidth\": 3.4, \"petalLength\": 1.9, \"petalWidth\": 0.2, \"species\": \"setosa\"}, {\"sepalLength\": 5.0, \"sepalWidth\": 3.0, \"petalLength\": 1.6, \"petalWidth\": 0.2, \"species\": \"setosa\"}, {\"sepalLength\": 5.0, \"sepalWidth\": 3.4, \"petalLength\": 1.6, \"petalWidth\": 0.4, \"species\": \"setosa\"}, {\"sepalLength\": 5.2, \"sepalWidth\": 3.5, \"petalLength\": 1.5, \"petalWidth\": 0.2, \"species\": \"setosa\"}, {\"sepalLength\": 5.2, \"sepalWidth\": 3.4, \"petalLength\": 1.4, \"petalWidth\": 0.2, \"species\": \"setosa\"}, {\"sepalLength\": 4.7, \"sepalWidth\": 3.2, \"petalLength\": 1.6, \"petalWidth\": 0.2, \"species\": \"setosa\"}, {\"sepalLength\": 4.8, \"sepalWidth\": 3.1, \"petalLength\": 1.6, \"petalWidth\": 0.2, \"species\": \"setosa\"}, {\"sepalLength\": 5.4, \"sepalWidth\": 3.4, \"petalLength\": 1.5, \"petalWidth\": 0.4, \"species\": \"setosa\"}, {\"sepalLength\": 5.2, \"sepalWidth\": 4.1, \"petalLength\": 1.5, \"petalWidth\": 0.1, \"species\": \"setosa\"}, {\"sepalLength\": 5.5, \"sepalWidth\": 4.2, \"petalLength\": 1.4, \"petalWidth\": 0.2, \"species\": \"setosa\"}, {\"sepalLength\": 4.9, \"sepalWidth\": 3.1, \"petalLength\": 1.5, \"petalWidth\": 0.2, \"species\": \"setosa\"}, {\"sepalLength\": 5.0, \"sepalWidth\": 3.2, \"petalLength\": 1.2, \"petalWidth\": 0.2, \"species\": \"setosa\"}, {\"sepalLength\": 5.5, \"sepalWidth\": 3.5, \"petalLength\": 1.3, \"petalWidth\": 0.2, \"species\": \"setosa\"}, {\"sepalLength\": 4.9, \"sepalWidth\": 3.6, \"petalLength\": 1.4, \"petalWidth\": 0.1, \"species\": \"setosa\"}, {\"sepalLength\": 4.4, \"sepalWidth\": 3.0, \"petalLength\": 1.3, \"petalWidth\": 0.2, \"species\": \"setosa\"}, {\"sepalLength\": 5.1, \"sepalWidth\": 3.4, \"petalLength\": 1.5, \"petalWidth\": 0.2, \"species\": \"setosa\"}, {\"sepalLength\": 5.0, \"sepalWidth\": 3.5, \"petalLength\": 1.3, \"petalWidth\": 0.30000000000000004, \"species\": \"setosa\"}, {\"sepalLength\": 4.5, \"sepalWidth\": 2.3, \"petalLength\": 1.3, \"petalWidth\": 0.30000000000000004, \"species\": \"setosa\"}, {\"sepalLength\": 4.4, \"sepalWidth\": 3.2, \"petalLength\": 1.3, \"petalWidth\": 0.2, \"species\": \"setosa\"}, {\"sepalLength\": 5.0, \"sepalWidth\": 3.5, \"petalLength\": 1.6, \"petalWidth\": 0.6000000000000001, \"species\": \"setosa\"}, {\"sepalLength\": 5.1, \"sepalWidth\": 3.8, \"petalLength\": 1.9, \"petalWidth\": 0.4, \"species\": \"setosa\"}, {\"sepalLength\": 4.8, \"sepalWidth\": 3.0, \"petalLength\": 1.4, \"petalWidth\": 0.30000000000000004, \"species\": \"setosa\"}, {\"sepalLength\": 5.1, \"sepalWidth\": 3.8, \"petalLength\": 1.6, \"petalWidth\": 0.2, \"species\": \"setosa\"}, {\"sepalLength\": 4.6, \"sepalWidth\": 3.2, \"petalLength\": 1.4, \"petalWidth\": 0.2, \"species\": \"setosa\"}, {\"sepalLength\": 5.3, \"sepalWidth\": 3.7, \"petalLength\": 1.5, \"petalWidth\": 0.2, \"species\": \"setosa\"}, {\"sepalLength\": 5.0, \"sepalWidth\": 3.3, \"petalLength\": 1.4, \"petalWidth\": 0.2, \"species\": \"setosa\"}, {\"sepalLength\": 7.0, \"sepalWidth\": 3.2, \"petalLength\": 4.7, \"petalWidth\": 1.4, \"species\": \"versicolor\"}, {\"sepalLength\": 6.4, \"sepalWidth\": 3.2, \"petalLength\": 4.5, \"petalWidth\": 1.5, \"species\": \"versicolor\"}, {\"sepalLength\": 6.9, \"sepalWidth\": 3.1, \"petalLength\": 4.9, \"petalWidth\": 1.5, \"species\": \"versicolor\"}, {\"sepalLength\": 5.5, \"sepalWidth\": 2.3, \"petalLength\": 4.0, \"petalWidth\": 1.3, \"species\": \"versicolor\"}, {\"sepalLength\": 6.5, \"sepalWidth\": 2.8, \"petalLength\": 4.6, \"petalWidth\": 1.5, \"species\": \"versicolor\"}, {\"sepalLength\": 5.7, \"sepalWidth\": 2.8, \"petalLength\": 4.5, \"petalWidth\": 1.3, \"species\": \"versicolor\"}, {\"sepalLength\": 6.3, \"sepalWidth\": 3.3, \"petalLength\": 4.7, \"petalWidth\": 1.6, \"species\": \"versicolor\"}, {\"sepalLength\": 4.9, \"sepalWidth\": 2.4, \"petalLength\": 3.3, \"petalWidth\": 1.0, \"species\": \"versicolor\"}, {\"sepalLength\": 6.6, \"sepalWidth\": 2.9, \"petalLength\": 4.6, \"petalWidth\": 1.3, \"species\": \"versicolor\"}, {\"sepalLength\": 5.2, \"sepalWidth\": 2.7, \"petalLength\": 3.9, \"petalWidth\": 1.4, \"species\": \"versicolor\"}, {\"sepalLength\": 5.0, \"sepalWidth\": 2.0, \"petalLength\": 3.5, \"petalWidth\": 1.0, \"species\": \"versicolor\"}, {\"sepalLength\": 5.9, \"sepalWidth\": 3.0, \"petalLength\": 4.2, \"petalWidth\": 1.5, \"species\": \"versicolor\"}, {\"sepalLength\": 6.0, \"sepalWidth\": 2.2, \"petalLength\": 4.0, \"petalWidth\": 1.0, \"species\": \"versicolor\"}, {\"sepalLength\": 6.1, \"sepalWidth\": 2.9, \"petalLength\": 4.7, \"petalWidth\": 1.4, \"species\": \"versicolor\"}, {\"sepalLength\": 5.6, \"sepalWidth\": 2.9, \"petalLength\": 3.6, \"petalWidth\": 1.3, \"species\": \"versicolor\"}, {\"sepalLength\": 6.7, \"sepalWidth\": 3.1, \"petalLength\": 4.4, \"petalWidth\": 1.4, \"species\": \"versicolor\"}, {\"sepalLength\": 5.6, \"sepalWidth\": 3.0, \"petalLength\": 4.5, \"petalWidth\": 1.5, \"species\": \"versicolor\"}, {\"sepalLength\": 5.8, \"sepalWidth\": 2.7, \"petalLength\": 4.1, \"petalWidth\": 1.0, \"species\": \"versicolor\"}, {\"sepalLength\": 6.2, \"sepalWidth\": 2.2, \"petalLength\": 4.5, \"petalWidth\": 1.5, \"species\": \"versicolor\"}, {\"sepalLength\": 5.6, \"sepalWidth\": 2.5, \"petalLength\": 3.9, \"petalWidth\": 1.1, \"species\": \"versicolor\"}, {\"sepalLength\": 5.9, \"sepalWidth\": 3.2, \"petalLength\": 4.8, \"petalWidth\": 1.8, \"species\": \"versicolor\"}, {\"sepalLength\": 6.1, \"sepalWidth\": 2.8, \"petalLength\": 4.0, \"petalWidth\": 1.3, \"species\": \"versicolor\"}, {\"sepalLength\": 6.3, \"sepalWidth\": 2.5, \"petalLength\": 4.9, \"petalWidth\": 1.5, \"species\": \"versicolor\"}, {\"sepalLength\": 6.1, \"sepalWidth\": 2.8, \"petalLength\": 4.7, \"petalWidth\": 1.2, \"species\": \"versicolor\"}, {\"sepalLength\": 6.4, \"sepalWidth\": 2.9, \"petalLength\": 4.3, \"petalWidth\": 1.3, \"species\": \"versicolor\"}, {\"sepalLength\": 6.6, \"sepalWidth\": 3.0, \"petalLength\": 4.4, \"petalWidth\": 1.4, \"species\": \"versicolor\"}, {\"sepalLength\": 6.8, \"sepalWidth\": 2.8, \"petalLength\": 4.8, \"petalWidth\": 1.4, \"species\": \"versicolor\"}, {\"sepalLength\": 6.7, \"sepalWidth\": 3.0, \"petalLength\": 5.0, \"petalWidth\": 1.7000000000000002, \"species\": \"versicolor\"}, {\"sepalLength\": 6.0, \"sepalWidth\": 2.9, \"petalLength\": 4.5, \"petalWidth\": 1.5, \"species\": \"versicolor\"}, {\"sepalLength\": 5.7, \"sepalWidth\": 2.6, \"petalLength\": 3.5, \"petalWidth\": 1.0, \"species\": \"versicolor\"}, {\"sepalLength\": 5.5, \"sepalWidth\": 2.4, \"petalLength\": 3.8, \"petalWidth\": 1.1, \"species\": \"versicolor\"}, {\"sepalLength\": 5.5, \"sepalWidth\": 2.4, \"petalLength\": 3.7, \"petalWidth\": 1.0, \"species\": \"versicolor\"}, {\"sepalLength\": 5.8, \"sepalWidth\": 2.7, \"petalLength\": 3.9, \"petalWidth\": 1.2, \"species\": \"versicolor\"}, {\"sepalLength\": 6.0, \"sepalWidth\": 2.7, \"petalLength\": 5.1, \"petalWidth\": 1.6, \"species\": \"versicolor\"}, {\"sepalLength\": 5.4, \"sepalWidth\": 3.0, \"petalLength\": 4.5, \"petalWidth\": 1.5, \"species\": \"versicolor\"}, {\"sepalLength\": 6.0, \"sepalWidth\": 3.4, \"petalLength\": 4.5, \"petalWidth\": 1.6, \"species\": \"versicolor\"}, {\"sepalLength\": 6.7, \"sepalWidth\": 3.1, \"petalLength\": 4.7, \"petalWidth\": 1.5, \"species\": \"versicolor\"}, {\"sepalLength\": 6.3, \"sepalWidth\": 2.3, \"petalLength\": 4.4, \"petalWidth\": 1.3, \"species\": \"versicolor\"}, {\"sepalLength\": 5.6, \"sepalWidth\": 3.0, \"petalLength\": 4.1, \"petalWidth\": 1.3, \"species\": \"versicolor\"}, {\"sepalLength\": 5.5, \"sepalWidth\": 2.5, \"petalLength\": 4.0, \"petalWidth\": 1.3, \"species\": \"versicolor\"}, {\"sepalLength\": 5.5, \"sepalWidth\": 2.6, \"petalLength\": 4.4, \"petalWidth\": 1.2, \"species\": \"versicolor\"}, {\"sepalLength\": 6.1, \"sepalWidth\": 3.0, \"petalLength\": 4.6, \"petalWidth\": 1.4, \"species\": \"versicolor\"}, {\"sepalLength\": 5.8, \"sepalWidth\": 2.6, \"petalLength\": 4.0, \"petalWidth\": 1.2, \"species\": \"versicolor\"}, {\"sepalLength\": 5.0, \"sepalWidth\": 2.3, \"petalLength\": 3.3, \"petalWidth\": 1.0, \"species\": \"versicolor\"}, {\"sepalLength\": 5.6, \"sepalWidth\": 2.7, \"petalLength\": 4.2, \"petalWidth\": 1.3, \"species\": \"versicolor\"}, {\"sepalLength\": 5.7, \"sepalWidth\": 3.0, \"petalLength\": 4.2, \"petalWidth\": 1.2, \"species\": \"versicolor\"}, {\"sepalLength\": 5.7, \"sepalWidth\": 2.9, \"petalLength\": 4.2, \"petalWidth\": 1.3, \"species\": \"versicolor\"}, {\"sepalLength\": 6.2, \"sepalWidth\": 2.9, \"petalLength\": 4.3, \"petalWidth\": 1.3, \"species\": \"versicolor\"}, {\"sepalLength\": 5.1, \"sepalWidth\": 2.5, \"petalLength\": 3.0, \"petalWidth\": 1.1, \"species\": \"versicolor\"}, {\"sepalLength\": 5.7, \"sepalWidth\": 2.8, \"petalLength\": 4.1, \"petalWidth\": 1.3, \"species\": \"versicolor\"}, {\"sepalLength\": 6.3, \"sepalWidth\": 3.3, \"petalLength\": 6.0, \"petalWidth\": 2.5, \"species\": \"virginica\"}, {\"sepalLength\": 5.8, \"sepalWidth\": 2.7, \"petalLength\": 5.1, \"petalWidth\": 1.9, \"species\": \"virginica\"}, {\"sepalLength\": 7.1, \"sepalWidth\": 3.0, \"petalLength\": 5.9, \"petalWidth\": 2.1, \"species\": \"virginica\"}, {\"sepalLength\": 6.3, \"sepalWidth\": 2.9, \"petalLength\": 5.6, \"petalWidth\": 1.8, \"species\": \"virginica\"}, {\"sepalLength\": 6.5, \"sepalWidth\": 3.0, \"petalLength\": 5.8, \"petalWidth\": 2.2, \"species\": \"virginica\"}, {\"sepalLength\": 7.6, \"sepalWidth\": 3.0, \"petalLength\": 6.6, \"petalWidth\": 2.1, \"species\": \"virginica\"}, {\"sepalLength\": 4.9, \"sepalWidth\": 2.5, \"petalLength\": 4.5, \"petalWidth\": 1.7000000000000002, \"species\": \"virginica\"}, {\"sepalLength\": 7.3, \"sepalWidth\": 2.9, \"petalLength\": 6.3, \"petalWidth\": 1.8, \"species\": \"virginica\"}, {\"sepalLength\": 6.7, \"sepalWidth\": 2.5, \"petalLength\": 5.8, \"petalWidth\": 1.8, \"species\": \"virginica\"}, {\"sepalLength\": 7.2, \"sepalWidth\": 3.6, \"petalLength\": 6.1, \"petalWidth\": 2.5, \"species\": \"virginica\"}, {\"sepalLength\": 6.5, \"sepalWidth\": 3.2, \"petalLength\": 5.1, \"petalWidth\": 2.0, \"species\": \"virginica\"}, {\"sepalLength\": 6.4, \"sepalWidth\": 2.7, \"petalLength\": 5.3, \"petalWidth\": 1.9, \"species\": \"virginica\"}, {\"sepalLength\": 6.8, \"sepalWidth\": 3.0, \"petalLength\": 5.5, \"petalWidth\": 2.1, \"species\": \"virginica\"}, {\"sepalLength\": 5.7, \"sepalWidth\": 2.5, \"petalLength\": 5.0, \"petalWidth\": 2.0, \"species\": \"virginica\"}, {\"sepalLength\": 5.8, \"sepalWidth\": 2.8, \"petalLength\": 5.1, \"petalWidth\": 2.4, \"species\": \"virginica\"}, {\"sepalLength\": 6.4, \"sepalWidth\": 3.2, \"petalLength\": 5.3, \"petalWidth\": 2.3, \"species\": \"virginica\"}, {\"sepalLength\": 6.5, \"sepalWidth\": 3.0, \"petalLength\": 5.5, \"petalWidth\": 1.8, \"species\": \"virginica\"}, {\"sepalLength\": 7.7, \"sepalWidth\": 3.8, \"petalLength\": 6.7, \"petalWidth\": 2.2, \"species\": \"virginica\"}, {\"sepalLength\": 7.7, \"sepalWidth\": 2.6, \"petalLength\": 6.9, \"petalWidth\": 2.3, \"species\": \"virginica\"}, {\"sepalLength\": 6.0, \"sepalWidth\": 2.2, \"petalLength\": 5.0, \"petalWidth\": 1.5, \"species\": \"virginica\"}, {\"sepalLength\": 6.9, \"sepalWidth\": 3.2, \"petalLength\": 5.7, \"petalWidth\": 2.3, \"species\": \"virginica\"}, {\"sepalLength\": 5.6, \"sepalWidth\": 2.8, \"petalLength\": 4.9, \"petalWidth\": 2.0, \"species\": \"virginica\"}, {\"sepalLength\": 7.7, \"sepalWidth\": 2.8, \"petalLength\": 6.7, \"petalWidth\": 2.0, \"species\": \"virginica\"}, {\"sepalLength\": 6.3, \"sepalWidth\": 2.7, \"petalLength\": 4.9, \"petalWidth\": 1.8, \"species\": \"virginica\"}, {\"sepalLength\": 6.7, \"sepalWidth\": 3.3, \"petalLength\": 5.7, \"petalWidth\": 2.1, \"species\": \"virginica\"}, {\"sepalLength\": 7.2, \"sepalWidth\": 3.2, \"petalLength\": 6.0, \"petalWidth\": 1.8, \"species\": \"virginica\"}, {\"sepalLength\": 6.2, \"sepalWidth\": 2.8, \"petalLength\": 4.8, \"petalWidth\": 1.8, \"species\": \"virginica\"}, {\"sepalLength\": 6.1, \"sepalWidth\": 3.0, \"petalLength\": 4.9, \"petalWidth\": 1.8, \"species\": \"virginica\"}, {\"sepalLength\": 6.4, \"sepalWidth\": 2.8, \"petalLength\": 5.6, \"petalWidth\": 2.1, \"species\": \"virginica\"}, {\"sepalLength\": 7.2, \"sepalWidth\": 3.0, \"petalLength\": 5.8, \"petalWidth\": 1.6, \"species\": \"virginica\"}, {\"sepalLength\": 7.4, \"sepalWidth\": 2.8, \"petalLength\": 6.1, \"petalWidth\": 1.9, \"species\": \"virginica\"}, {\"sepalLength\": 7.9, \"sepalWidth\": 3.8, \"petalLength\": 6.4, \"petalWidth\": 2.0, \"species\": \"virginica\"}, {\"sepalLength\": 6.4, \"sepalWidth\": 2.8, \"petalLength\": 5.6, \"petalWidth\": 2.2, \"species\": \"virginica\"}, {\"sepalLength\": 6.3, \"sepalWidth\": 2.8, \"petalLength\": 5.1, \"petalWidth\": 1.5, \"species\": \"virginica\"}, {\"sepalLength\": 6.1, \"sepalWidth\": 2.6, \"petalLength\": 5.6, \"petalWidth\": 1.4, \"species\": \"virginica\"}, {\"sepalLength\": 7.7, \"sepalWidth\": 3.0, \"petalLength\": 6.1, \"petalWidth\": 2.3, \"species\": \"virginica\"}, {\"sepalLength\": 6.3, \"sepalWidth\": 3.4, \"petalLength\": 5.6, \"petalWidth\": 2.4, \"species\": \"virginica\"}, {\"sepalLength\": 6.4, \"sepalWidth\": 3.1, \"petalLength\": 5.5, \"petalWidth\": 1.8, \"species\": \"virginica\"}, {\"sepalLength\": 6.0, \"sepalWidth\": 3.0, \"petalLength\": 4.8, \"petalWidth\": 1.8, \"species\": \"virginica\"}, {\"sepalLength\": 6.9, \"sepalWidth\": 3.1, \"petalLength\": 5.4, \"petalWidth\": 2.1, \"species\": \"virginica\"}, {\"sepalLength\": 6.7, \"sepalWidth\": 3.1, \"petalLength\": 5.6, \"petalWidth\": 2.4, \"species\": \"virginica\"}, {\"sepalLength\": 6.9, \"sepalWidth\": 3.1, \"petalLength\": 5.1, \"petalWidth\": 2.3, \"species\": \"virginica\"}, {\"sepalLength\": 5.8, \"sepalWidth\": 2.7, \"petalLength\": 5.1, \"petalWidth\": 1.9, \"species\": \"virginica\"}, {\"sepalLength\": 6.8, \"sepalWidth\": 3.2, \"petalLength\": 5.9, \"petalWidth\": 2.3, \"species\": \"virginica\"}, {\"sepalLength\": 6.7, \"sepalWidth\": 3.3, \"petalLength\": 5.7, \"petalWidth\": 2.5, \"species\": \"virginica\"}, {\"sepalLength\": 6.7, \"sepalWidth\": 3.0, \"petalLength\": 5.2, \"petalWidth\": 2.3, \"species\": \"virginica\"}, {\"sepalLength\": 6.3, \"sepalWidth\": 2.5, \"petalLength\": 5.0, \"petalWidth\": 1.9, \"species\": \"virginica\"}, {\"sepalLength\": 6.5, \"sepalWidth\": 3.0, \"petalLength\": 5.2, \"petalWidth\": 2.0, \"species\": \"virginica\"}, {\"sepalLength\": 6.2, \"sepalWidth\": 3.4, \"petalLength\": 5.4, \"petalWidth\": 2.3, \"species\": \"virginica\"}, {\"sepalLength\": 5.9, \"sepalWidth\": 3.0, \"petalLength\": 5.1, \"petalWidth\": 1.8, \"species\": \"virginica\"}]}}, {\"mode\": \"vega-lite\"});\n",
       "</script>"
      ],
      "text/plain": [
       "alt.HConcatChart(...)"
      ]
     },
     "execution_count": 54,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "#分面\n",
    "h=alt.Chart(iris,width=300).mark_bar(color='#1EAFAE').encode(\n",
    "    alt.X('sepalWidth:Q', bin=alt.BinParams(maxbins=20)),\n",
    "    alt.Y('count()')\n",
    ")\n",
    "box=alt.Chart(iris,width=300).mark_boxplot(color='#1EAFAE').encode(\n",
    "    x='species',\n",
    "    y='petalLength'\n",
    ")\n",
    "\n",
    "h|box"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 55,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "\n",
       "<div id=\"altair-viz-b46321d3f0914cc88145e0262fda3b22\"></div>\n",
       "<script type=\"text/javascript\">\n",
       "  (function(spec, embedOpt){\n",
       "    const outputDiv = document.getElementById(\"altair-viz-b46321d3f0914cc88145e0262fda3b22\");\n",
       "    const paths = {\n",
       "      \"vega\": \"https://cdn.jsdelivr.net/npm//vega@5?noext\",\n",
       "      \"vega-lib\": \"https://cdn.jsdelivr.net/npm//vega-lib?noext\",\n",
       "      \"vega-lite\": \"https://cdn.jsdelivr.net/npm//vega-lite@4.0.2?noext\",\n",
       "      \"vega-embed\": \"https://cdn.jsdelivr.net/npm//vega-embed@6?noext\",\n",
       "    };\n",
       "\n",
       "    function loadScript(lib) {\n",
       "      return new Promise(function(resolve, reject) {\n",
       "        var s = document.createElement('script');\n",
       "        s.src = paths[lib];\n",
       "        s.async = true;\n",
       "        s.onload = () => resolve(paths[lib]);\n",
       "        s.onerror = () => reject(`Error loading script: ${paths[lib]}`);\n",
       "        document.getElementsByTagName(\"head\")[0].appendChild(s);\n",
       "      });\n",
       "    }\n",
       "\n",
       "    function showError(err) {\n",
       "      outputDiv.innerHTML = `<div class=\"error\" style=\"color:red;\">${err}</div>`;\n",
       "      throw err;\n",
       "    }\n",
       "\n",
       "    function displayChart(vegaEmbed) {\n",
       "      vegaEmbed(outputDiv, spec, embedOpt)\n",
       "        .catch(err => showError(`Javascript Error: ${err.message}<br>This usually means there's a typo in your chart specification. See the javascript console for the full traceback.`));\n",
       "    }\n",
       "\n",
       "    if(typeof define === \"function\" && define.amd) {\n",
       "      requirejs.config({paths});\n",
       "      require([\"vega-embed\"], displayChart, err => showError(`Error loading script: ${err.message}`));\n",
       "    } else if (typeof vegaEmbed === \"function\") {\n",
       "      displayChart(vegaEmbed);\n",
       "    } else {\n",
       "      loadScript(\"vega\")\n",
       "        .then(() => loadScript(\"vega-lite\"))\n",
       "        .then(() => loadScript(\"vega-embed\"))\n",
       "        .catch(showError)\n",
       "        .then(() => displayChart(vegaEmbed));\n",
       "    }\n",
       "  })({\"config\": {\"view\": {\"continuousWidth\": 400, \"continuousHeight\": 300}}, \"hconcat\": [{\"mark\": {\"type\": \"bar\", \"color\": \"#1EAFAE\"}, \"encoding\": {\"x\": {\"type\": \"quantitative\", \"bin\": {\"maxbins\": 20}, \"field\": \"sepalWidth\"}, \"y\": {\"type\": \"quantitative\", \"aggregate\": \"count\"}}, \"selection\": {\"selector022\": {\"type\": \"interval\", \"bind\": \"scales\", \"encodings\": [\"x\", \"y\"]}}, \"width\": 300}, {\"mark\": {\"type\": \"boxplot\", \"color\": \"#1EAFAE\"}, \"encoding\": {\"x\": {\"type\": \"nominal\", \"field\": \"species\"}, \"y\": {\"type\": \"quantitative\", \"field\": \"petalLength\"}}, \"selection\": {\"selector023\": {\"type\": \"interval\", \"bind\": \"scales\", \"encodings\": [\"x\", \"y\"]}}, \"width\": 300}], \"data\": {\"name\": \"data-a264acbd6e539a8b3afc0cb5f240fb57\"}, \"$schema\": \"https://vega.github.io/schema/vega-lite/v4.0.2.json\", \"datasets\": {\"data-a264acbd6e539a8b3afc0cb5f240fb57\": [{\"sepalLength\": 5.1, \"sepalWidth\": 3.5, \"petalLength\": 1.4, \"petalWidth\": 0.2, \"species\": \"setosa\"}, {\"sepalLength\": 4.9, \"sepalWidth\": 3.0, \"petalLength\": 1.4, \"petalWidth\": 0.2, \"species\": \"setosa\"}, {\"sepalLength\": 4.7, \"sepalWidth\": 3.2, \"petalLength\": 1.3, \"petalWidth\": 0.2, \"species\": \"setosa\"}, {\"sepalLength\": 4.6, \"sepalWidth\": 3.1, \"petalLength\": 1.5, \"petalWidth\": 0.2, \"species\": \"setosa\"}, {\"sepalLength\": 5.0, \"sepalWidth\": 3.6, \"petalLength\": 1.4, \"petalWidth\": 0.2, \"species\": \"setosa\"}, {\"sepalLength\": 5.4, \"sepalWidth\": 3.9, \"petalLength\": 1.7000000000000002, \"petalWidth\": 0.4, \"species\": \"setosa\"}, {\"sepalLength\": 4.6, \"sepalWidth\": 3.4, \"petalLength\": 1.4, \"petalWidth\": 0.30000000000000004, \"species\": \"setosa\"}, {\"sepalLength\": 5.0, \"sepalWidth\": 3.4, \"petalLength\": 1.5, \"petalWidth\": 0.2, \"species\": \"setosa\"}, {\"sepalLength\": 4.4, \"sepalWidth\": 2.9, \"petalLength\": 1.4, \"petalWidth\": 0.2, \"species\": \"setosa\"}, {\"sepalLength\": 4.9, \"sepalWidth\": 3.1, \"petalLength\": 1.5, \"petalWidth\": 0.1, \"species\": \"setosa\"}, {\"sepalLength\": 5.4, \"sepalWidth\": 3.7, \"petalLength\": 1.5, \"petalWidth\": 0.2, \"species\": \"setosa\"}, {\"sepalLength\": 4.8, \"sepalWidth\": 3.4, \"petalLength\": 1.6, \"petalWidth\": 0.2, \"species\": \"setosa\"}, {\"sepalLength\": 4.8, \"sepalWidth\": 3.0, \"petalLength\": 1.4, \"petalWidth\": 0.1, \"species\": \"setosa\"}, {\"sepalLength\": 4.3, \"sepalWidth\": 3.0, \"petalLength\": 1.1, \"petalWidth\": 0.1, \"species\": \"setosa\"}, {\"sepalLength\": 5.8, \"sepalWidth\": 4.0, \"petalLength\": 1.2, \"petalWidth\": 0.2, \"species\": \"setosa\"}, {\"sepalLength\": 5.7, \"sepalWidth\": 4.4, \"petalLength\": 1.5, \"petalWidth\": 0.4, \"species\": \"setosa\"}, {\"sepalLength\": 5.4, \"sepalWidth\": 3.9, \"petalLength\": 1.3, \"petalWidth\": 0.4, \"species\": \"setosa\"}, {\"sepalLength\": 5.1, \"sepalWidth\": 3.5, \"petalLength\": 1.4, \"petalWidth\": 0.30000000000000004, \"species\": \"setosa\"}, {\"sepalLength\": 5.7, \"sepalWidth\": 3.8, \"petalLength\": 1.7000000000000002, \"petalWidth\": 0.30000000000000004, \"species\": \"setosa\"}, {\"sepalLength\": 5.1, \"sepalWidth\": 3.8, \"petalLength\": 1.5, \"petalWidth\": 0.30000000000000004, \"species\": \"setosa\"}, {\"sepalLength\": 5.4, \"sepalWidth\": 3.4, \"petalLength\": 1.7000000000000002, \"petalWidth\": 0.2, \"species\": \"setosa\"}, {\"sepalLength\": 5.1, \"sepalWidth\": 3.7, \"petalLength\": 1.5, \"petalWidth\": 0.4, \"species\": \"setosa\"}, {\"sepalLength\": 4.6, \"sepalWidth\": 3.6, \"petalLength\": 1.0, \"petalWidth\": 0.2, \"species\": \"setosa\"}, {\"sepalLength\": 5.1, \"sepalWidth\": 3.3, \"petalLength\": 1.7000000000000002, \"petalWidth\": 0.5, \"species\": \"setosa\"}, {\"sepalLength\": 4.8, \"sepalWidth\": 3.4, \"petalLength\": 1.9, \"petalWidth\": 0.2, \"species\": \"setosa\"}, {\"sepalLength\": 5.0, \"sepalWidth\": 3.0, \"petalLength\": 1.6, \"petalWidth\": 0.2, \"species\": \"setosa\"}, {\"sepalLength\": 5.0, \"sepalWidth\": 3.4, \"petalLength\": 1.6, \"petalWidth\": 0.4, \"species\": \"setosa\"}, {\"sepalLength\": 5.2, \"sepalWidth\": 3.5, \"petalLength\": 1.5, \"petalWidth\": 0.2, \"species\": \"setosa\"}, {\"sepalLength\": 5.2, \"sepalWidth\": 3.4, \"petalLength\": 1.4, \"petalWidth\": 0.2, \"species\": \"setosa\"}, {\"sepalLength\": 4.7, \"sepalWidth\": 3.2, \"petalLength\": 1.6, \"petalWidth\": 0.2, \"species\": \"setosa\"}, {\"sepalLength\": 4.8, \"sepalWidth\": 3.1, \"petalLength\": 1.6, \"petalWidth\": 0.2, \"species\": \"setosa\"}, {\"sepalLength\": 5.4, \"sepalWidth\": 3.4, \"petalLength\": 1.5, \"petalWidth\": 0.4, \"species\": \"setosa\"}, {\"sepalLength\": 5.2, \"sepalWidth\": 4.1, \"petalLength\": 1.5, \"petalWidth\": 0.1, \"species\": \"setosa\"}, {\"sepalLength\": 5.5, \"sepalWidth\": 4.2, \"petalLength\": 1.4, \"petalWidth\": 0.2, \"species\": \"setosa\"}, {\"sepalLength\": 4.9, \"sepalWidth\": 3.1, \"petalLength\": 1.5, \"petalWidth\": 0.2, \"species\": \"setosa\"}, {\"sepalLength\": 5.0, \"sepalWidth\": 3.2, \"petalLength\": 1.2, \"petalWidth\": 0.2, \"species\": \"setosa\"}, {\"sepalLength\": 5.5, \"sepalWidth\": 3.5, \"petalLength\": 1.3, \"petalWidth\": 0.2, \"species\": \"setosa\"}, {\"sepalLength\": 4.9, \"sepalWidth\": 3.6, \"petalLength\": 1.4, \"petalWidth\": 0.1, \"species\": \"setosa\"}, {\"sepalLength\": 4.4, \"sepalWidth\": 3.0, \"petalLength\": 1.3, \"petalWidth\": 0.2, \"species\": \"setosa\"}, {\"sepalLength\": 5.1, \"sepalWidth\": 3.4, \"petalLength\": 1.5, \"petalWidth\": 0.2, \"species\": \"setosa\"}, {\"sepalLength\": 5.0, \"sepalWidth\": 3.5, \"petalLength\": 1.3, \"petalWidth\": 0.30000000000000004, \"species\": \"setosa\"}, {\"sepalLength\": 4.5, \"sepalWidth\": 2.3, \"petalLength\": 1.3, \"petalWidth\": 0.30000000000000004, \"species\": \"setosa\"}, {\"sepalLength\": 4.4, \"sepalWidth\": 3.2, \"petalLength\": 1.3, \"petalWidth\": 0.2, \"species\": \"setosa\"}, {\"sepalLength\": 5.0, \"sepalWidth\": 3.5, \"petalLength\": 1.6, \"petalWidth\": 0.6000000000000001, \"species\": \"setosa\"}, {\"sepalLength\": 5.1, \"sepalWidth\": 3.8, \"petalLength\": 1.9, \"petalWidth\": 0.4, \"species\": \"setosa\"}, {\"sepalLength\": 4.8, \"sepalWidth\": 3.0, \"petalLength\": 1.4, \"petalWidth\": 0.30000000000000004, \"species\": \"setosa\"}, {\"sepalLength\": 5.1, \"sepalWidth\": 3.8, \"petalLength\": 1.6, \"petalWidth\": 0.2, \"species\": \"setosa\"}, {\"sepalLength\": 4.6, \"sepalWidth\": 3.2, \"petalLength\": 1.4, \"petalWidth\": 0.2, \"species\": \"setosa\"}, {\"sepalLength\": 5.3, \"sepalWidth\": 3.7, \"petalLength\": 1.5, \"petalWidth\": 0.2, \"species\": \"setosa\"}, {\"sepalLength\": 5.0, \"sepalWidth\": 3.3, \"petalLength\": 1.4, \"petalWidth\": 0.2, \"species\": \"setosa\"}, {\"sepalLength\": 7.0, \"sepalWidth\": 3.2, \"petalLength\": 4.7, \"petalWidth\": 1.4, \"species\": \"versicolor\"}, {\"sepalLength\": 6.4, \"sepalWidth\": 3.2, \"petalLength\": 4.5, \"petalWidth\": 1.5, \"species\": \"versicolor\"}, {\"sepalLength\": 6.9, \"sepalWidth\": 3.1, \"petalLength\": 4.9, \"petalWidth\": 1.5, \"species\": \"versicolor\"}, {\"sepalLength\": 5.5, \"sepalWidth\": 2.3, \"petalLength\": 4.0, \"petalWidth\": 1.3, \"species\": \"versicolor\"}, {\"sepalLength\": 6.5, \"sepalWidth\": 2.8, \"petalLength\": 4.6, \"petalWidth\": 1.5, \"species\": \"versicolor\"}, {\"sepalLength\": 5.7, \"sepalWidth\": 2.8, \"petalLength\": 4.5, \"petalWidth\": 1.3, \"species\": \"versicolor\"}, {\"sepalLength\": 6.3, \"sepalWidth\": 3.3, \"petalLength\": 4.7, \"petalWidth\": 1.6, \"species\": \"versicolor\"}, {\"sepalLength\": 4.9, \"sepalWidth\": 2.4, \"petalLength\": 3.3, \"petalWidth\": 1.0, \"species\": \"versicolor\"}, {\"sepalLength\": 6.6, \"sepalWidth\": 2.9, \"petalLength\": 4.6, \"petalWidth\": 1.3, \"species\": \"versicolor\"}, {\"sepalLength\": 5.2, \"sepalWidth\": 2.7, \"petalLength\": 3.9, \"petalWidth\": 1.4, \"species\": \"versicolor\"}, {\"sepalLength\": 5.0, \"sepalWidth\": 2.0, \"petalLength\": 3.5, \"petalWidth\": 1.0, \"species\": \"versicolor\"}, {\"sepalLength\": 5.9, \"sepalWidth\": 3.0, \"petalLength\": 4.2, \"petalWidth\": 1.5, \"species\": \"versicolor\"}, {\"sepalLength\": 6.0, \"sepalWidth\": 2.2, \"petalLength\": 4.0, \"petalWidth\": 1.0, \"species\": \"versicolor\"}, {\"sepalLength\": 6.1, \"sepalWidth\": 2.9, \"petalLength\": 4.7, \"petalWidth\": 1.4, \"species\": \"versicolor\"}, {\"sepalLength\": 5.6, \"sepalWidth\": 2.9, \"petalLength\": 3.6, \"petalWidth\": 1.3, \"species\": \"versicolor\"}, {\"sepalLength\": 6.7, \"sepalWidth\": 3.1, \"petalLength\": 4.4, \"petalWidth\": 1.4, \"species\": \"versicolor\"}, {\"sepalLength\": 5.6, \"sepalWidth\": 3.0, \"petalLength\": 4.5, \"petalWidth\": 1.5, \"species\": \"versicolor\"}, {\"sepalLength\": 5.8, \"sepalWidth\": 2.7, \"petalLength\": 4.1, \"petalWidth\": 1.0, \"species\": \"versicolor\"}, {\"sepalLength\": 6.2, \"sepalWidth\": 2.2, \"petalLength\": 4.5, \"petalWidth\": 1.5, \"species\": \"versicolor\"}, {\"sepalLength\": 5.6, \"sepalWidth\": 2.5, \"petalLength\": 3.9, \"petalWidth\": 1.1, \"species\": \"versicolor\"}, {\"sepalLength\": 5.9, \"sepalWidth\": 3.2, \"petalLength\": 4.8, \"petalWidth\": 1.8, \"species\": \"versicolor\"}, {\"sepalLength\": 6.1, \"sepalWidth\": 2.8, \"petalLength\": 4.0, \"petalWidth\": 1.3, \"species\": \"versicolor\"}, {\"sepalLength\": 6.3, \"sepalWidth\": 2.5, \"petalLength\": 4.9, \"petalWidth\": 1.5, \"species\": \"versicolor\"}, {\"sepalLength\": 6.1, \"sepalWidth\": 2.8, \"petalLength\": 4.7, \"petalWidth\": 1.2, \"species\": \"versicolor\"}, {\"sepalLength\": 6.4, \"sepalWidth\": 2.9, \"petalLength\": 4.3, \"petalWidth\": 1.3, \"species\": \"versicolor\"}, {\"sepalLength\": 6.6, \"sepalWidth\": 3.0, \"petalLength\": 4.4, \"petalWidth\": 1.4, \"species\": \"versicolor\"}, {\"sepalLength\": 6.8, \"sepalWidth\": 2.8, \"petalLength\": 4.8, \"petalWidth\": 1.4, \"species\": \"versicolor\"}, {\"sepalLength\": 6.7, \"sepalWidth\": 3.0, \"petalLength\": 5.0, \"petalWidth\": 1.7000000000000002, \"species\": \"versicolor\"}, {\"sepalLength\": 6.0, \"sepalWidth\": 2.9, \"petalLength\": 4.5, \"petalWidth\": 1.5, \"species\": \"versicolor\"}, {\"sepalLength\": 5.7, \"sepalWidth\": 2.6, \"petalLength\": 3.5, \"petalWidth\": 1.0, \"species\": \"versicolor\"}, {\"sepalLength\": 5.5, \"sepalWidth\": 2.4, \"petalLength\": 3.8, \"petalWidth\": 1.1, \"species\": \"versicolor\"}, {\"sepalLength\": 5.5, \"sepalWidth\": 2.4, \"petalLength\": 3.7, \"petalWidth\": 1.0, \"species\": \"versicolor\"}, {\"sepalLength\": 5.8, \"sepalWidth\": 2.7, \"petalLength\": 3.9, \"petalWidth\": 1.2, \"species\": \"versicolor\"}, {\"sepalLength\": 6.0, \"sepalWidth\": 2.7, \"petalLength\": 5.1, \"petalWidth\": 1.6, \"species\": \"versicolor\"}, {\"sepalLength\": 5.4, \"sepalWidth\": 3.0, \"petalLength\": 4.5, \"petalWidth\": 1.5, \"species\": \"versicolor\"}, {\"sepalLength\": 6.0, \"sepalWidth\": 3.4, \"petalLength\": 4.5, \"petalWidth\": 1.6, \"species\": \"versicolor\"}, {\"sepalLength\": 6.7, \"sepalWidth\": 3.1, \"petalLength\": 4.7, \"petalWidth\": 1.5, \"species\": \"versicolor\"}, {\"sepalLength\": 6.3, \"sepalWidth\": 2.3, \"petalLength\": 4.4, \"petalWidth\": 1.3, \"species\": \"versicolor\"}, {\"sepalLength\": 5.6, \"sepalWidth\": 3.0, \"petalLength\": 4.1, \"petalWidth\": 1.3, \"species\": \"versicolor\"}, {\"sepalLength\": 5.5, \"sepalWidth\": 2.5, \"petalLength\": 4.0, \"petalWidth\": 1.3, \"species\": \"versicolor\"}, {\"sepalLength\": 5.5, \"sepalWidth\": 2.6, \"petalLength\": 4.4, \"petalWidth\": 1.2, \"species\": \"versicolor\"}, {\"sepalLength\": 6.1, \"sepalWidth\": 3.0, \"petalLength\": 4.6, \"petalWidth\": 1.4, \"species\": \"versicolor\"}, {\"sepalLength\": 5.8, \"sepalWidth\": 2.6, \"petalLength\": 4.0, \"petalWidth\": 1.2, \"species\": \"versicolor\"}, {\"sepalLength\": 5.0, \"sepalWidth\": 2.3, \"petalLength\": 3.3, \"petalWidth\": 1.0, \"species\": \"versicolor\"}, {\"sepalLength\": 5.6, \"sepalWidth\": 2.7, \"petalLength\": 4.2, \"petalWidth\": 1.3, \"species\": \"versicolor\"}, {\"sepalLength\": 5.7, \"sepalWidth\": 3.0, \"petalLength\": 4.2, \"petalWidth\": 1.2, \"species\": \"versicolor\"}, {\"sepalLength\": 5.7, \"sepalWidth\": 2.9, \"petalLength\": 4.2, \"petalWidth\": 1.3, \"species\": \"versicolor\"}, {\"sepalLength\": 6.2, \"sepalWidth\": 2.9, \"petalLength\": 4.3, \"petalWidth\": 1.3, \"species\": \"versicolor\"}, {\"sepalLength\": 5.1, \"sepalWidth\": 2.5, \"petalLength\": 3.0, \"petalWidth\": 1.1, \"species\": \"versicolor\"}, {\"sepalLength\": 5.7, \"sepalWidth\": 2.8, \"petalLength\": 4.1, \"petalWidth\": 1.3, \"species\": \"versicolor\"}, {\"sepalLength\": 6.3, \"sepalWidth\": 3.3, \"petalLength\": 6.0, \"petalWidth\": 2.5, \"species\": \"virginica\"}, {\"sepalLength\": 5.8, \"sepalWidth\": 2.7, \"petalLength\": 5.1, \"petalWidth\": 1.9, \"species\": \"virginica\"}, {\"sepalLength\": 7.1, \"sepalWidth\": 3.0, \"petalLength\": 5.9, \"petalWidth\": 2.1, \"species\": \"virginica\"}, {\"sepalLength\": 6.3, \"sepalWidth\": 2.9, \"petalLength\": 5.6, \"petalWidth\": 1.8, \"species\": \"virginica\"}, {\"sepalLength\": 6.5, \"sepalWidth\": 3.0, \"petalLength\": 5.8, \"petalWidth\": 2.2, \"species\": \"virginica\"}, {\"sepalLength\": 7.6, \"sepalWidth\": 3.0, \"petalLength\": 6.6, \"petalWidth\": 2.1, \"species\": \"virginica\"}, {\"sepalLength\": 4.9, \"sepalWidth\": 2.5, \"petalLength\": 4.5, \"petalWidth\": 1.7000000000000002, \"species\": \"virginica\"}, {\"sepalLength\": 7.3, \"sepalWidth\": 2.9, \"petalLength\": 6.3, \"petalWidth\": 1.8, \"species\": \"virginica\"}, {\"sepalLength\": 6.7, \"sepalWidth\": 2.5, \"petalLength\": 5.8, \"petalWidth\": 1.8, \"species\": \"virginica\"}, {\"sepalLength\": 7.2, \"sepalWidth\": 3.6, \"petalLength\": 6.1, \"petalWidth\": 2.5, \"species\": \"virginica\"}, {\"sepalLength\": 6.5, \"sepalWidth\": 3.2, \"petalLength\": 5.1, \"petalWidth\": 2.0, \"species\": \"virginica\"}, {\"sepalLength\": 6.4, \"sepalWidth\": 2.7, \"petalLength\": 5.3, \"petalWidth\": 1.9, \"species\": \"virginica\"}, {\"sepalLength\": 6.8, \"sepalWidth\": 3.0, \"petalLength\": 5.5, \"petalWidth\": 2.1, \"species\": \"virginica\"}, {\"sepalLength\": 5.7, \"sepalWidth\": 2.5, \"petalLength\": 5.0, \"petalWidth\": 2.0, \"species\": \"virginica\"}, {\"sepalLength\": 5.8, \"sepalWidth\": 2.8, \"petalLength\": 5.1, \"petalWidth\": 2.4, \"species\": \"virginica\"}, {\"sepalLength\": 6.4, \"sepalWidth\": 3.2, \"petalLength\": 5.3, \"petalWidth\": 2.3, \"species\": \"virginica\"}, {\"sepalLength\": 6.5, \"sepalWidth\": 3.0, \"petalLength\": 5.5, \"petalWidth\": 1.8, \"species\": \"virginica\"}, {\"sepalLength\": 7.7, \"sepalWidth\": 3.8, \"petalLength\": 6.7, \"petalWidth\": 2.2, \"species\": \"virginica\"}, {\"sepalLength\": 7.7, \"sepalWidth\": 2.6, \"petalLength\": 6.9, \"petalWidth\": 2.3, \"species\": \"virginica\"}, {\"sepalLength\": 6.0, \"sepalWidth\": 2.2, \"petalLength\": 5.0, \"petalWidth\": 1.5, \"species\": \"virginica\"}, {\"sepalLength\": 6.9, \"sepalWidth\": 3.2, \"petalLength\": 5.7, \"petalWidth\": 2.3, \"species\": \"virginica\"}, {\"sepalLength\": 5.6, \"sepalWidth\": 2.8, \"petalLength\": 4.9, \"petalWidth\": 2.0, \"species\": \"virginica\"}, {\"sepalLength\": 7.7, \"sepalWidth\": 2.8, \"petalLength\": 6.7, \"petalWidth\": 2.0, \"species\": \"virginica\"}, {\"sepalLength\": 6.3, \"sepalWidth\": 2.7, \"petalLength\": 4.9, \"petalWidth\": 1.8, \"species\": \"virginica\"}, {\"sepalLength\": 6.7, \"sepalWidth\": 3.3, \"petalLength\": 5.7, \"petalWidth\": 2.1, \"species\": \"virginica\"}, {\"sepalLength\": 7.2, \"sepalWidth\": 3.2, \"petalLength\": 6.0, \"petalWidth\": 1.8, \"species\": \"virginica\"}, {\"sepalLength\": 6.2, \"sepalWidth\": 2.8, \"petalLength\": 4.8, \"petalWidth\": 1.8, \"species\": \"virginica\"}, {\"sepalLength\": 6.1, \"sepalWidth\": 3.0, \"petalLength\": 4.9, \"petalWidth\": 1.8, \"species\": \"virginica\"}, {\"sepalLength\": 6.4, \"sepalWidth\": 2.8, \"petalLength\": 5.6, \"petalWidth\": 2.1, \"species\": \"virginica\"}, {\"sepalLength\": 7.2, \"sepalWidth\": 3.0, \"petalLength\": 5.8, \"petalWidth\": 1.6, \"species\": \"virginica\"}, {\"sepalLength\": 7.4, \"sepalWidth\": 2.8, \"petalLength\": 6.1, \"petalWidth\": 1.9, \"species\": \"virginica\"}, {\"sepalLength\": 7.9, \"sepalWidth\": 3.8, \"petalLength\": 6.4, \"petalWidth\": 2.0, \"species\": \"virginica\"}, {\"sepalLength\": 6.4, \"sepalWidth\": 2.8, \"petalLength\": 5.6, \"petalWidth\": 2.2, \"species\": \"virginica\"}, {\"sepalLength\": 6.3, \"sepalWidth\": 2.8, \"petalLength\": 5.1, \"petalWidth\": 1.5, \"species\": \"virginica\"}, {\"sepalLength\": 6.1, \"sepalWidth\": 2.6, \"petalLength\": 5.6, \"petalWidth\": 1.4, \"species\": \"virginica\"}, {\"sepalLength\": 7.7, \"sepalWidth\": 3.0, \"petalLength\": 6.1, \"petalWidth\": 2.3, \"species\": \"virginica\"}, {\"sepalLength\": 6.3, \"sepalWidth\": 3.4, \"petalLength\": 5.6, \"petalWidth\": 2.4, \"species\": \"virginica\"}, {\"sepalLength\": 6.4, \"sepalWidth\": 3.1, \"petalLength\": 5.5, \"petalWidth\": 1.8, \"species\": \"virginica\"}, {\"sepalLength\": 6.0, \"sepalWidth\": 3.0, \"petalLength\": 4.8, \"petalWidth\": 1.8, \"species\": \"virginica\"}, {\"sepalLength\": 6.9, \"sepalWidth\": 3.1, \"petalLength\": 5.4, \"petalWidth\": 2.1, \"species\": \"virginica\"}, {\"sepalLength\": 6.7, \"sepalWidth\": 3.1, \"petalLength\": 5.6, \"petalWidth\": 2.4, \"species\": \"virginica\"}, {\"sepalLength\": 6.9, \"sepalWidth\": 3.1, \"petalLength\": 5.1, \"petalWidth\": 2.3, \"species\": \"virginica\"}, {\"sepalLength\": 5.8, \"sepalWidth\": 2.7, \"petalLength\": 5.1, \"petalWidth\": 1.9, \"species\": \"virginica\"}, {\"sepalLength\": 6.8, \"sepalWidth\": 3.2, \"petalLength\": 5.9, \"petalWidth\": 2.3, \"species\": \"virginica\"}, {\"sepalLength\": 6.7, \"sepalWidth\": 3.3, \"petalLength\": 5.7, \"petalWidth\": 2.5, \"species\": \"virginica\"}, {\"sepalLength\": 6.7, \"sepalWidth\": 3.0, \"petalLength\": 5.2, \"petalWidth\": 2.3, \"species\": \"virginica\"}, {\"sepalLength\": 6.3, \"sepalWidth\": 2.5, \"petalLength\": 5.0, \"petalWidth\": 1.9, \"species\": \"virginica\"}, {\"sepalLength\": 6.5, \"sepalWidth\": 3.0, \"petalLength\": 5.2, \"petalWidth\": 2.0, \"species\": \"virginica\"}, {\"sepalLength\": 6.2, \"sepalWidth\": 3.4, \"petalLength\": 5.4, \"petalWidth\": 2.3, \"species\": \"virginica\"}, {\"sepalLength\": 5.9, \"sepalWidth\": 3.0, \"petalLength\": 5.1, \"petalWidth\": 1.8, \"species\": \"virginica\"}]}}, {\"mode\": \"vega-lite\"});\n",
       "</script>"
      ],
      "text/plain": [
       "alt.HConcatChart(...)"
      ]
     },
     "execution_count": 55,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "#分面\n",
    "h=alt.Chart(iris,width=300).mark_bar(color='#1EAFAE').encode(\n",
    "    alt.X('sepalWidth:Q', bin=alt.BinParams(maxbins=20)),\n",
    "    alt.Y('count()')\n",
    ").interactive()\n",
    "box=alt.Chart(iris,width=300).mark_boxplot(color='#1EAFAE').encode(\n",
    "    x='species',\n",
    "    y='petalLength'\n",
    ").interactive()\n",
    "\n",
    "h|box"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 153,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "\n",
       "<div id=\"altair-viz-843b96092cb34b7ca35dcf86297e6975\"></div>\n",
       "<script type=\"text/javascript\">\n",
       "  (function(spec, embedOpt){\n",
       "    const outputDiv = document.getElementById(\"altair-viz-843b96092cb34b7ca35dcf86297e6975\");\n",
       "    const paths = {\n",
       "      \"vega\": \"https://cdn.jsdelivr.net/npm//vega@5?noext\",\n",
       "      \"vega-lib\": \"https://cdn.jsdelivr.net/npm//vega-lib?noext\",\n",
       "      \"vega-lite\": \"https://cdn.jsdelivr.net/npm//vega-lite@4.0.2?noext\",\n",
       "      \"vega-embed\": \"https://cdn.jsdelivr.net/npm//vega-embed@6?noext\",\n",
       "    };\n",
       "\n",
       "    function loadScript(lib) {\n",
       "      return new Promise(function(resolve, reject) {\n",
       "        var s = document.createElement('script');\n",
       "        s.src = paths[lib];\n",
       "        s.async = true;\n",
       "        s.onload = () => resolve(paths[lib]);\n",
       "        s.onerror = () => reject(`Error loading script: ${paths[lib]}`);\n",
       "        document.getElementsByTagName(\"head\")[0].appendChild(s);\n",
       "      });\n",
       "    }\n",
       "\n",
       "    function showError(err) {\n",
       "      outputDiv.innerHTML = `<div class=\"error\" style=\"color:red;\">${err}</div>`;\n",
       "      throw err;\n",
       "    }\n",
       "\n",
       "    function displayChart(vegaEmbed) {\n",
       "      vegaEmbed(outputDiv, spec, embedOpt)\n",
       "        .catch(err => showError(`Javascript Error: ${err.message}<br>This usually means there's a typo in your chart specification. See the javascript console for the full traceback.`));\n",
       "    }\n",
       "\n",
       "    if(typeof define === \"function\" && define.amd) {\n",
       "      requirejs.config({paths});\n",
       "      require([\"vega-embed\"], displayChart, err => showError(`Error loading script: ${err.message}`));\n",
       "    } else if (typeof vegaEmbed === \"function\") {\n",
       "      displayChart(vegaEmbed);\n",
       "    } else {\n",
       "      loadScript(\"vega\")\n",
       "        .then(() => loadScript(\"vega-lite\"))\n",
       "        .then(() => loadScript(\"vega-embed\"))\n",
       "        .catch(showError)\n",
       "        .then(() => displayChart(vegaEmbed));\n",
       "    }\n",
       "  })({\"config\": {\"view\": {\"height\": 300, \"width\": 400}, \"mark\": {\"color\": \"#1eafae\"}}, \"vconcat\": [{\"mark\": {\"type\": \"bar\", \"color\": \"#1EAFAE\"}, \"encoding\": {\"x\": {\"type\": \"quantitative\", \"bin\": {\"maxbins\": 20}, \"field\": \"sepalWidth\"}, \"y\": {\"type\": \"quantitative\", \"aggregate\": \"count\"}}, \"selection\": {\"selector096\": {\"type\": \"interval\", \"bind\": \"scales\", \"encodings\": [\"x\", \"y\"]}}, \"width\": 400}, {\"mark\": {\"type\": \"boxplot\", \"color\": \"#1EAFAE\"}, \"encoding\": {\"x\": {\"type\": \"nominal\", \"field\": \"species\"}, \"y\": {\"type\": \"quantitative\", \"field\": \"petalLength\"}}, \"selection\": {\"selector097\": {\"type\": \"interval\", \"bind\": \"scales\", \"encodings\": [\"x\", \"y\"]}}, \"width\": 400}], \"data\": {\"name\": \"data-a264acbd6e539a8b3afc0cb5f240fb57\"}, \"$schema\": \"https://vega.github.io/schema/vega-lite/v4.0.2.json\", \"datasets\": {\"data-a264acbd6e539a8b3afc0cb5f240fb57\": [{\"sepalLength\": 5.1, \"sepalWidth\": 3.5, \"petalLength\": 1.4, \"petalWidth\": 0.2, \"species\": \"setosa\"}, {\"sepalLength\": 4.9, \"sepalWidth\": 3.0, \"petalLength\": 1.4, \"petalWidth\": 0.2, \"species\": \"setosa\"}, {\"sepalLength\": 4.7, \"sepalWidth\": 3.2, \"petalLength\": 1.3, \"petalWidth\": 0.2, \"species\": \"setosa\"}, {\"sepalLength\": 4.6, \"sepalWidth\": 3.1, \"petalLength\": 1.5, \"petalWidth\": 0.2, \"species\": \"setosa\"}, {\"sepalLength\": 5.0, \"sepalWidth\": 3.6, \"petalLength\": 1.4, \"petalWidth\": 0.2, \"species\": \"setosa\"}, {\"sepalLength\": 5.4, \"sepalWidth\": 3.9, \"petalLength\": 1.7000000000000002, \"petalWidth\": 0.4, \"species\": \"setosa\"}, {\"sepalLength\": 4.6, \"sepalWidth\": 3.4, \"petalLength\": 1.4, \"petalWidth\": 0.30000000000000004, \"species\": \"setosa\"}, {\"sepalLength\": 5.0, \"sepalWidth\": 3.4, \"petalLength\": 1.5, \"petalWidth\": 0.2, \"species\": \"setosa\"}, {\"sepalLength\": 4.4, \"sepalWidth\": 2.9, \"petalLength\": 1.4, \"petalWidth\": 0.2, \"species\": \"setosa\"}, {\"sepalLength\": 4.9, \"sepalWidth\": 3.1, \"petalLength\": 1.5, \"petalWidth\": 0.1, \"species\": \"setosa\"}, {\"sepalLength\": 5.4, \"sepalWidth\": 3.7, \"petalLength\": 1.5, \"petalWidth\": 0.2, \"species\": \"setosa\"}, {\"sepalLength\": 4.8, \"sepalWidth\": 3.4, \"petalLength\": 1.6, \"petalWidth\": 0.2, \"species\": \"setosa\"}, {\"sepalLength\": 4.8, \"sepalWidth\": 3.0, \"petalLength\": 1.4, \"petalWidth\": 0.1, \"species\": \"setosa\"}, {\"sepalLength\": 4.3, \"sepalWidth\": 3.0, \"petalLength\": 1.1, \"petalWidth\": 0.1, \"species\": \"setosa\"}, {\"sepalLength\": 5.8, \"sepalWidth\": 4.0, \"petalLength\": 1.2, \"petalWidth\": 0.2, \"species\": \"setosa\"}, {\"sepalLength\": 5.7, \"sepalWidth\": 4.4, \"petalLength\": 1.5, \"petalWidth\": 0.4, \"species\": \"setosa\"}, {\"sepalLength\": 5.4, \"sepalWidth\": 3.9, \"petalLength\": 1.3, \"petalWidth\": 0.4, \"species\": \"setosa\"}, {\"sepalLength\": 5.1, \"sepalWidth\": 3.5, \"petalLength\": 1.4, \"petalWidth\": 0.30000000000000004, \"species\": \"setosa\"}, {\"sepalLength\": 5.7, \"sepalWidth\": 3.8, \"petalLength\": 1.7000000000000002, \"petalWidth\": 0.30000000000000004, \"species\": \"setosa\"}, {\"sepalLength\": 5.1, \"sepalWidth\": 3.8, \"petalLength\": 1.5, \"petalWidth\": 0.30000000000000004, \"species\": \"setosa\"}, {\"sepalLength\": 5.4, \"sepalWidth\": 3.4, \"petalLength\": 1.7000000000000002, \"petalWidth\": 0.2, \"species\": \"setosa\"}, {\"sepalLength\": 5.1, \"sepalWidth\": 3.7, \"petalLength\": 1.5, \"petalWidth\": 0.4, \"species\": \"setosa\"}, {\"sepalLength\": 4.6, \"sepalWidth\": 3.6, \"petalLength\": 1.0, \"petalWidth\": 0.2, \"species\": \"setosa\"}, {\"sepalLength\": 5.1, \"sepalWidth\": 3.3, \"petalLength\": 1.7000000000000002, \"petalWidth\": 0.5, \"species\": \"setosa\"}, {\"sepalLength\": 4.8, \"sepalWidth\": 3.4, \"petalLength\": 1.9, \"petalWidth\": 0.2, \"species\": \"setosa\"}, {\"sepalLength\": 5.0, \"sepalWidth\": 3.0, \"petalLength\": 1.6, \"petalWidth\": 0.2, \"species\": \"setosa\"}, {\"sepalLength\": 5.0, \"sepalWidth\": 3.4, \"petalLength\": 1.6, \"petalWidth\": 0.4, \"species\": \"setosa\"}, {\"sepalLength\": 5.2, \"sepalWidth\": 3.5, \"petalLength\": 1.5, \"petalWidth\": 0.2, \"species\": \"setosa\"}, {\"sepalLength\": 5.2, \"sepalWidth\": 3.4, \"petalLength\": 1.4, \"petalWidth\": 0.2, \"species\": \"setosa\"}, {\"sepalLength\": 4.7, \"sepalWidth\": 3.2, \"petalLength\": 1.6, \"petalWidth\": 0.2, \"species\": \"setosa\"}, {\"sepalLength\": 4.8, \"sepalWidth\": 3.1, \"petalLength\": 1.6, \"petalWidth\": 0.2, \"species\": \"setosa\"}, {\"sepalLength\": 5.4, \"sepalWidth\": 3.4, \"petalLength\": 1.5, \"petalWidth\": 0.4, \"species\": \"setosa\"}, {\"sepalLength\": 5.2, \"sepalWidth\": 4.1, \"petalLength\": 1.5, \"petalWidth\": 0.1, \"species\": \"setosa\"}, {\"sepalLength\": 5.5, \"sepalWidth\": 4.2, \"petalLength\": 1.4, \"petalWidth\": 0.2, \"species\": \"setosa\"}, {\"sepalLength\": 4.9, \"sepalWidth\": 3.1, \"petalLength\": 1.5, \"petalWidth\": 0.2, \"species\": \"setosa\"}, {\"sepalLength\": 5.0, \"sepalWidth\": 3.2, \"petalLength\": 1.2, \"petalWidth\": 0.2, \"species\": \"setosa\"}, {\"sepalLength\": 5.5, \"sepalWidth\": 3.5, \"petalLength\": 1.3, \"petalWidth\": 0.2, \"species\": \"setosa\"}, {\"sepalLength\": 4.9, \"sepalWidth\": 3.6, \"petalLength\": 1.4, \"petalWidth\": 0.1, \"species\": \"setosa\"}, {\"sepalLength\": 4.4, \"sepalWidth\": 3.0, \"petalLength\": 1.3, \"petalWidth\": 0.2, \"species\": \"setosa\"}, {\"sepalLength\": 5.1, \"sepalWidth\": 3.4, \"petalLength\": 1.5, \"petalWidth\": 0.2, \"species\": \"setosa\"}, {\"sepalLength\": 5.0, \"sepalWidth\": 3.5, \"petalLength\": 1.3, \"petalWidth\": 0.30000000000000004, \"species\": \"setosa\"}, {\"sepalLength\": 4.5, \"sepalWidth\": 2.3, \"petalLength\": 1.3, \"petalWidth\": 0.30000000000000004, \"species\": \"setosa\"}, {\"sepalLength\": 4.4, \"sepalWidth\": 3.2, \"petalLength\": 1.3, \"petalWidth\": 0.2, \"species\": \"setosa\"}, {\"sepalLength\": 5.0, \"sepalWidth\": 3.5, \"petalLength\": 1.6, \"petalWidth\": 0.6000000000000001, \"species\": \"setosa\"}, {\"sepalLength\": 5.1, \"sepalWidth\": 3.8, \"petalLength\": 1.9, \"petalWidth\": 0.4, \"species\": \"setosa\"}, {\"sepalLength\": 4.8, \"sepalWidth\": 3.0, \"petalLength\": 1.4, \"petalWidth\": 0.30000000000000004, \"species\": \"setosa\"}, {\"sepalLength\": 5.1, \"sepalWidth\": 3.8, \"petalLength\": 1.6, \"petalWidth\": 0.2, \"species\": \"setosa\"}, {\"sepalLength\": 4.6, \"sepalWidth\": 3.2, \"petalLength\": 1.4, \"petalWidth\": 0.2, \"species\": \"setosa\"}, {\"sepalLength\": 5.3, \"sepalWidth\": 3.7, \"petalLength\": 1.5, \"petalWidth\": 0.2, \"species\": \"setosa\"}, {\"sepalLength\": 5.0, \"sepalWidth\": 3.3, \"petalLength\": 1.4, \"petalWidth\": 0.2, \"species\": \"setosa\"}, {\"sepalLength\": 7.0, \"sepalWidth\": 3.2, \"petalLength\": 4.7, \"petalWidth\": 1.4, \"species\": \"versicolor\"}, {\"sepalLength\": 6.4, \"sepalWidth\": 3.2, \"petalLength\": 4.5, \"petalWidth\": 1.5, \"species\": \"versicolor\"}, {\"sepalLength\": 6.9, \"sepalWidth\": 3.1, \"petalLength\": 4.9, \"petalWidth\": 1.5, \"species\": \"versicolor\"}, {\"sepalLength\": 5.5, \"sepalWidth\": 2.3, \"petalLength\": 4.0, \"petalWidth\": 1.3, \"species\": \"versicolor\"}, {\"sepalLength\": 6.5, \"sepalWidth\": 2.8, \"petalLength\": 4.6, \"petalWidth\": 1.5, \"species\": \"versicolor\"}, {\"sepalLength\": 5.7, \"sepalWidth\": 2.8, \"petalLength\": 4.5, \"petalWidth\": 1.3, \"species\": \"versicolor\"}, {\"sepalLength\": 6.3, \"sepalWidth\": 3.3, \"petalLength\": 4.7, \"petalWidth\": 1.6, \"species\": \"versicolor\"}, {\"sepalLength\": 4.9, \"sepalWidth\": 2.4, \"petalLength\": 3.3, \"petalWidth\": 1.0, \"species\": \"versicolor\"}, {\"sepalLength\": 6.6, \"sepalWidth\": 2.9, \"petalLength\": 4.6, \"petalWidth\": 1.3, \"species\": \"versicolor\"}, {\"sepalLength\": 5.2, \"sepalWidth\": 2.7, \"petalLength\": 3.9, \"petalWidth\": 1.4, \"species\": \"versicolor\"}, {\"sepalLength\": 5.0, \"sepalWidth\": 2.0, \"petalLength\": 3.5, \"petalWidth\": 1.0, \"species\": \"versicolor\"}, {\"sepalLength\": 5.9, \"sepalWidth\": 3.0, \"petalLength\": 4.2, \"petalWidth\": 1.5, \"species\": \"versicolor\"}, {\"sepalLength\": 6.0, \"sepalWidth\": 2.2, \"petalLength\": 4.0, \"petalWidth\": 1.0, \"species\": \"versicolor\"}, {\"sepalLength\": 6.1, \"sepalWidth\": 2.9, \"petalLength\": 4.7, \"petalWidth\": 1.4, \"species\": \"versicolor\"}, {\"sepalLength\": 5.6, \"sepalWidth\": 2.9, \"petalLength\": 3.6, \"petalWidth\": 1.3, \"species\": \"versicolor\"}, {\"sepalLength\": 6.7, \"sepalWidth\": 3.1, \"petalLength\": 4.4, \"petalWidth\": 1.4, \"species\": \"versicolor\"}, {\"sepalLength\": 5.6, \"sepalWidth\": 3.0, \"petalLength\": 4.5, \"petalWidth\": 1.5, \"species\": \"versicolor\"}, {\"sepalLength\": 5.8, \"sepalWidth\": 2.7, \"petalLength\": 4.1, \"petalWidth\": 1.0, \"species\": \"versicolor\"}, {\"sepalLength\": 6.2, \"sepalWidth\": 2.2, \"petalLength\": 4.5, \"petalWidth\": 1.5, \"species\": \"versicolor\"}, {\"sepalLength\": 5.6, \"sepalWidth\": 2.5, \"petalLength\": 3.9, \"petalWidth\": 1.1, \"species\": \"versicolor\"}, {\"sepalLength\": 5.9, \"sepalWidth\": 3.2, \"petalLength\": 4.8, \"petalWidth\": 1.8, \"species\": \"versicolor\"}, {\"sepalLength\": 6.1, \"sepalWidth\": 2.8, \"petalLength\": 4.0, \"petalWidth\": 1.3, \"species\": \"versicolor\"}, {\"sepalLength\": 6.3, \"sepalWidth\": 2.5, \"petalLength\": 4.9, \"petalWidth\": 1.5, \"species\": \"versicolor\"}, {\"sepalLength\": 6.1, \"sepalWidth\": 2.8, \"petalLength\": 4.7, \"petalWidth\": 1.2, \"species\": \"versicolor\"}, {\"sepalLength\": 6.4, \"sepalWidth\": 2.9, \"petalLength\": 4.3, \"petalWidth\": 1.3, \"species\": \"versicolor\"}, {\"sepalLength\": 6.6, \"sepalWidth\": 3.0, \"petalLength\": 4.4, \"petalWidth\": 1.4, \"species\": \"versicolor\"}, {\"sepalLength\": 6.8, \"sepalWidth\": 2.8, \"petalLength\": 4.8, \"petalWidth\": 1.4, \"species\": \"versicolor\"}, {\"sepalLength\": 6.7, \"sepalWidth\": 3.0, \"petalLength\": 5.0, \"petalWidth\": 1.7000000000000002, \"species\": \"versicolor\"}, {\"sepalLength\": 6.0, \"sepalWidth\": 2.9, \"petalLength\": 4.5, \"petalWidth\": 1.5, \"species\": \"versicolor\"}, {\"sepalLength\": 5.7, \"sepalWidth\": 2.6, \"petalLength\": 3.5, \"petalWidth\": 1.0, \"species\": \"versicolor\"}, {\"sepalLength\": 5.5, \"sepalWidth\": 2.4, \"petalLength\": 3.8, \"petalWidth\": 1.1, \"species\": \"versicolor\"}, {\"sepalLength\": 5.5, \"sepalWidth\": 2.4, \"petalLength\": 3.7, \"petalWidth\": 1.0, \"species\": \"versicolor\"}, {\"sepalLength\": 5.8, \"sepalWidth\": 2.7, \"petalLength\": 3.9, \"petalWidth\": 1.2, \"species\": \"versicolor\"}, {\"sepalLength\": 6.0, \"sepalWidth\": 2.7, \"petalLength\": 5.1, \"petalWidth\": 1.6, \"species\": \"versicolor\"}, {\"sepalLength\": 5.4, \"sepalWidth\": 3.0, \"petalLength\": 4.5, \"petalWidth\": 1.5, \"species\": \"versicolor\"}, {\"sepalLength\": 6.0, \"sepalWidth\": 3.4, \"petalLength\": 4.5, \"petalWidth\": 1.6, \"species\": \"versicolor\"}, {\"sepalLength\": 6.7, \"sepalWidth\": 3.1, \"petalLength\": 4.7, \"petalWidth\": 1.5, \"species\": \"versicolor\"}, {\"sepalLength\": 6.3, \"sepalWidth\": 2.3, \"petalLength\": 4.4, \"petalWidth\": 1.3, \"species\": \"versicolor\"}, {\"sepalLength\": 5.6, \"sepalWidth\": 3.0, \"petalLength\": 4.1, \"petalWidth\": 1.3, \"species\": \"versicolor\"}, {\"sepalLength\": 5.5, \"sepalWidth\": 2.5, \"petalLength\": 4.0, \"petalWidth\": 1.3, \"species\": \"versicolor\"}, {\"sepalLength\": 5.5, \"sepalWidth\": 2.6, \"petalLength\": 4.4, \"petalWidth\": 1.2, \"species\": \"versicolor\"}, {\"sepalLength\": 6.1, \"sepalWidth\": 3.0, \"petalLength\": 4.6, \"petalWidth\": 1.4, \"species\": \"versicolor\"}, {\"sepalLength\": 5.8, \"sepalWidth\": 2.6, \"petalLength\": 4.0, \"petalWidth\": 1.2, \"species\": \"versicolor\"}, {\"sepalLength\": 5.0, \"sepalWidth\": 2.3, \"petalLength\": 3.3, \"petalWidth\": 1.0, \"species\": \"versicolor\"}, {\"sepalLength\": 5.6, \"sepalWidth\": 2.7, \"petalLength\": 4.2, \"petalWidth\": 1.3, \"species\": \"versicolor\"}, {\"sepalLength\": 5.7, \"sepalWidth\": 3.0, \"petalLength\": 4.2, \"petalWidth\": 1.2, \"species\": \"versicolor\"}, {\"sepalLength\": 5.7, \"sepalWidth\": 2.9, \"petalLength\": 4.2, \"petalWidth\": 1.3, \"species\": \"versicolor\"}, {\"sepalLength\": 6.2, \"sepalWidth\": 2.9, \"petalLength\": 4.3, \"petalWidth\": 1.3, \"species\": \"versicolor\"}, {\"sepalLength\": 5.1, \"sepalWidth\": 2.5, \"petalLength\": 3.0, \"petalWidth\": 1.1, \"species\": \"versicolor\"}, {\"sepalLength\": 5.7, \"sepalWidth\": 2.8, \"petalLength\": 4.1, \"petalWidth\": 1.3, \"species\": \"versicolor\"}, {\"sepalLength\": 6.3, \"sepalWidth\": 3.3, \"petalLength\": 6.0, \"petalWidth\": 2.5, \"species\": \"virginica\"}, {\"sepalLength\": 5.8, \"sepalWidth\": 2.7, \"petalLength\": 5.1, \"petalWidth\": 1.9, \"species\": \"virginica\"}, {\"sepalLength\": 7.1, \"sepalWidth\": 3.0, \"petalLength\": 5.9, \"petalWidth\": 2.1, \"species\": \"virginica\"}, {\"sepalLength\": 6.3, \"sepalWidth\": 2.9, \"petalLength\": 5.6, \"petalWidth\": 1.8, \"species\": \"virginica\"}, {\"sepalLength\": 6.5, \"sepalWidth\": 3.0, \"petalLength\": 5.8, \"petalWidth\": 2.2, \"species\": \"virginica\"}, {\"sepalLength\": 7.6, \"sepalWidth\": 3.0, \"petalLength\": 6.6, \"petalWidth\": 2.1, \"species\": \"virginica\"}, {\"sepalLength\": 4.9, \"sepalWidth\": 2.5, \"petalLength\": 4.5, \"petalWidth\": 1.7000000000000002, \"species\": \"virginica\"}, {\"sepalLength\": 7.3, \"sepalWidth\": 2.9, \"petalLength\": 6.3, \"petalWidth\": 1.8, \"species\": \"virginica\"}, {\"sepalLength\": 6.7, \"sepalWidth\": 2.5, \"petalLength\": 5.8, \"petalWidth\": 1.8, \"species\": \"virginica\"}, {\"sepalLength\": 7.2, \"sepalWidth\": 3.6, \"petalLength\": 6.1, \"petalWidth\": 2.5, \"species\": \"virginica\"}, {\"sepalLength\": 6.5, \"sepalWidth\": 3.2, \"petalLength\": 5.1, \"petalWidth\": 2.0, \"species\": \"virginica\"}, {\"sepalLength\": 6.4, \"sepalWidth\": 2.7, \"petalLength\": 5.3, \"petalWidth\": 1.9, \"species\": \"virginica\"}, {\"sepalLength\": 6.8, \"sepalWidth\": 3.0, \"petalLength\": 5.5, \"petalWidth\": 2.1, \"species\": \"virginica\"}, {\"sepalLength\": 5.7, \"sepalWidth\": 2.5, \"petalLength\": 5.0, \"petalWidth\": 2.0, \"species\": \"virginica\"}, {\"sepalLength\": 5.8, \"sepalWidth\": 2.8, \"petalLength\": 5.1, \"petalWidth\": 2.4, \"species\": \"virginica\"}, {\"sepalLength\": 6.4, \"sepalWidth\": 3.2, \"petalLength\": 5.3, \"petalWidth\": 2.3, \"species\": \"virginica\"}, {\"sepalLength\": 6.5, \"sepalWidth\": 3.0, \"petalLength\": 5.5, \"petalWidth\": 1.8, \"species\": \"virginica\"}, {\"sepalLength\": 7.7, \"sepalWidth\": 3.8, \"petalLength\": 6.7, \"petalWidth\": 2.2, \"species\": \"virginica\"}, {\"sepalLength\": 7.7, \"sepalWidth\": 2.6, \"petalLength\": 6.9, \"petalWidth\": 2.3, \"species\": \"virginica\"}, {\"sepalLength\": 6.0, \"sepalWidth\": 2.2, \"petalLength\": 5.0, \"petalWidth\": 1.5, \"species\": \"virginica\"}, {\"sepalLength\": 6.9, \"sepalWidth\": 3.2, \"petalLength\": 5.7, \"petalWidth\": 2.3, \"species\": \"virginica\"}, {\"sepalLength\": 5.6, \"sepalWidth\": 2.8, \"petalLength\": 4.9, \"petalWidth\": 2.0, \"species\": \"virginica\"}, {\"sepalLength\": 7.7, \"sepalWidth\": 2.8, \"petalLength\": 6.7, \"petalWidth\": 2.0, \"species\": \"virginica\"}, {\"sepalLength\": 6.3, \"sepalWidth\": 2.7, \"petalLength\": 4.9, \"petalWidth\": 1.8, \"species\": \"virginica\"}, {\"sepalLength\": 6.7, \"sepalWidth\": 3.3, \"petalLength\": 5.7, \"petalWidth\": 2.1, \"species\": \"virginica\"}, {\"sepalLength\": 7.2, \"sepalWidth\": 3.2, \"petalLength\": 6.0, \"petalWidth\": 1.8, \"species\": \"virginica\"}, {\"sepalLength\": 6.2, \"sepalWidth\": 2.8, \"petalLength\": 4.8, \"petalWidth\": 1.8, \"species\": \"virginica\"}, {\"sepalLength\": 6.1, \"sepalWidth\": 3.0, \"petalLength\": 4.9, \"petalWidth\": 1.8, \"species\": \"virginica\"}, {\"sepalLength\": 6.4, \"sepalWidth\": 2.8, \"petalLength\": 5.6, \"petalWidth\": 2.1, \"species\": \"virginica\"}, {\"sepalLength\": 7.2, \"sepalWidth\": 3.0, \"petalLength\": 5.8, \"petalWidth\": 1.6, \"species\": \"virginica\"}, {\"sepalLength\": 7.4, \"sepalWidth\": 2.8, \"petalLength\": 6.1, \"petalWidth\": 1.9, \"species\": \"virginica\"}, {\"sepalLength\": 7.9, \"sepalWidth\": 3.8, \"petalLength\": 6.4, \"petalWidth\": 2.0, \"species\": \"virginica\"}, {\"sepalLength\": 6.4, \"sepalWidth\": 2.8, \"petalLength\": 5.6, \"petalWidth\": 2.2, \"species\": \"virginica\"}, {\"sepalLength\": 6.3, \"sepalWidth\": 2.8, \"petalLength\": 5.1, \"petalWidth\": 1.5, \"species\": \"virginica\"}, {\"sepalLength\": 6.1, \"sepalWidth\": 2.6, \"petalLength\": 5.6, \"petalWidth\": 1.4, \"species\": \"virginica\"}, {\"sepalLength\": 7.7, \"sepalWidth\": 3.0, \"petalLength\": 6.1, \"petalWidth\": 2.3, \"species\": \"virginica\"}, {\"sepalLength\": 6.3, \"sepalWidth\": 3.4, \"petalLength\": 5.6, \"petalWidth\": 2.4, \"species\": \"virginica\"}, {\"sepalLength\": 6.4, \"sepalWidth\": 3.1, \"petalLength\": 5.5, \"petalWidth\": 1.8, \"species\": \"virginica\"}, {\"sepalLength\": 6.0, \"sepalWidth\": 3.0, \"petalLength\": 4.8, \"petalWidth\": 1.8, \"species\": \"virginica\"}, {\"sepalLength\": 6.9, \"sepalWidth\": 3.1, \"petalLength\": 5.4, \"petalWidth\": 2.1, \"species\": \"virginica\"}, {\"sepalLength\": 6.7, \"sepalWidth\": 3.1, \"petalLength\": 5.6, \"petalWidth\": 2.4, \"species\": \"virginica\"}, {\"sepalLength\": 6.9, \"sepalWidth\": 3.1, \"petalLength\": 5.1, \"petalWidth\": 2.3, \"species\": \"virginica\"}, {\"sepalLength\": 5.8, \"sepalWidth\": 2.7, \"petalLength\": 5.1, \"petalWidth\": 1.9, \"species\": \"virginica\"}, {\"sepalLength\": 6.8, \"sepalWidth\": 3.2, \"petalLength\": 5.9, \"petalWidth\": 2.3, \"species\": \"virginica\"}, {\"sepalLength\": 6.7, \"sepalWidth\": 3.3, \"petalLength\": 5.7, \"petalWidth\": 2.5, \"species\": \"virginica\"}, {\"sepalLength\": 6.7, \"sepalWidth\": 3.0, \"petalLength\": 5.2, \"petalWidth\": 2.3, \"species\": \"virginica\"}, {\"sepalLength\": 6.3, \"sepalWidth\": 2.5, \"petalLength\": 5.0, \"petalWidth\": 1.9, \"species\": \"virginica\"}, {\"sepalLength\": 6.5, \"sepalWidth\": 3.0, \"petalLength\": 5.2, \"petalWidth\": 2.0, \"species\": \"virginica\"}, {\"sepalLength\": 6.2, \"sepalWidth\": 3.4, \"petalLength\": 5.4, \"petalWidth\": 2.3, \"species\": \"virginica\"}, {\"sepalLength\": 5.9, \"sepalWidth\": 3.0, \"petalLength\": 5.1, \"petalWidth\": 1.8, \"species\": \"virginica\"}]}}, {\"mode\": \"vega-lite\"});\n",
       "</script>"
      ],
      "text/plain": [
       "alt.VConcatChart(...)"
      ]
     },
     "execution_count": 153,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "h=alt.Chart(iris,width=400).mark_bar(color='#1EAFAE').encode(\n",
    "    alt.X('sepalWidth:Q', bin=alt.BinParams(maxbins=20)),\n",
    "    alt.Y('count()')\n",
    ").interactive()\n",
    "box=alt.Chart(iris,width=400).mark_boxplot(color='#1EAFAE').encode(\n",
    "    x='species',\n",
    "    y='petalLength'\n",
    ").interactive()\n",
    "h & box #上下排列"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 61,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Name</th>\n",
       "      <th>Miles_per_Gallon</th>\n",
       "      <th>Cylinders</th>\n",
       "      <th>Displacement</th>\n",
       "      <th>Horsepower</th>\n",
       "      <th>Weight_in_lbs</th>\n",
       "      <th>Acceleration</th>\n",
       "      <th>Year</th>\n",
       "      <th>Origin</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>chevrolet chevelle malibu</td>\n",
       "      <td>18.0</td>\n",
       "      <td>8</td>\n",
       "      <td>307.0</td>\n",
       "      <td>130.0</td>\n",
       "      <td>3504</td>\n",
       "      <td>12.0</td>\n",
       "      <td>1970-01-01</td>\n",
       "      <td>USA</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>buick skylark 320</td>\n",
       "      <td>15.0</td>\n",
       "      <td>8</td>\n",
       "      <td>350.0</td>\n",
       "      <td>165.0</td>\n",
       "      <td>3693</td>\n",
       "      <td>11.5</td>\n",
       "      <td>1970-01-01</td>\n",
       "      <td>USA</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                        Name  Miles_per_Gallon  Cylinders  Displacement  \\\n",
       "0  chevrolet chevelle malibu              18.0          8         307.0   \n",
       "1          buick skylark 320              15.0          8         350.0   \n",
       "\n",
       "   Horsepower  Weight_in_lbs  Acceleration       Year Origin  \n",
       "0       130.0           3504          12.0 1970-01-01    USA  \n",
       "1       165.0           3693          11.5 1970-01-01    USA  "
      ]
     },
     "execution_count": 61,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "source.head(2)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 70,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": 63,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "356"
      ]
     },
     "execution_count": 63,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "len(set(source['Weight_in_lbs']))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 154,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "\n",
       "<div id=\"altair-viz-2194606df4f14871b3c9a9b0508170d2\"></div>\n",
       "<script type=\"text/javascript\">\n",
       "  (function(spec, embedOpt){\n",
       "    const outputDiv = document.getElementById(\"altair-viz-2194606df4f14871b3c9a9b0508170d2\");\n",
       "    const paths = {\n",
       "      \"vega\": \"https://cdn.jsdelivr.net/npm//vega@5?noext\",\n",
       "      \"vega-lib\": \"https://cdn.jsdelivr.net/npm//vega-lib?noext\",\n",
       "      \"vega-lite\": \"https://cdn.jsdelivr.net/npm//vega-lite@4.0.2?noext\",\n",
       "      \"vega-embed\": \"https://cdn.jsdelivr.net/npm//vega-embed@6?noext\",\n",
       "    };\n",
       "\n",
       "    function loadScript(lib) {\n",
       "      return new Promise(function(resolve, reject) {\n",
       "        var s = document.createElement('script');\n",
       "        s.src = paths[lib];\n",
       "        s.async = true;\n",
       "        s.onload = () => resolve(paths[lib]);\n",
       "        s.onerror = () => reject(`Error loading script: ${paths[lib]}`);\n",
       "        document.getElementsByTagName(\"head\")[0].appendChild(s);\n",
       "      });\n",
       "    }\n",
       "\n",
       "    function showError(err) {\n",
       "      outputDiv.innerHTML = `<div class=\"error\" style=\"color:red;\">${err}</div>`;\n",
       "      throw err;\n",
       "    }\n",
       "\n",
       "    function displayChart(vegaEmbed) {\n",
       "      vegaEmbed(outputDiv, spec, embedOpt)\n",
       "        .catch(err => showError(`Javascript Error: ${err.message}<br>This usually means there's a typo in your chart specification. See the javascript console for the full traceback.`));\n",
       "    }\n",
       "\n",
       "    if(typeof define === \"function\" && define.amd) {\n",
       "      requirejs.config({paths});\n",
       "      require([\"vega-embed\"], displayChart, err => showError(`Error loading script: ${err.message}`));\n",
       "    } else if (typeof vegaEmbed === \"function\") {\n",
       "      displayChart(vegaEmbed);\n",
       "    } else {\n",
       "      loadScript(\"vega\")\n",
       "        .then(() => loadScript(\"vega-lite\"))\n",
       "        .then(() => loadScript(\"vega-embed\"))\n",
       "        .catch(showError)\n",
       "        .then(() => displayChart(vegaEmbed));\n",
       "    }\n",
       "  })({\"config\": {\"view\": {\"height\": 300, \"width\": 400}, \"mark\": {\"color\": \"#1eafae\"}}, \"repeat\": {\"column\": [\"Miles_per_Gallon\", \"Acceleration\", \"Horsepower\"], \"row\": [\"Horsepower\", \"Acceleration\", \"Miles_per_Gallon\"]}, \"spec\": {\"data\": {\"name\": \"data-f02450ab61490a1363517a0190416235\"}, \"mark\": \"circle\", \"encoding\": {\"color\": {\"type\": \"nominal\", \"field\": \"Origin\"}, \"x\": {\"type\": \"quantitative\", \"field\": {\"repeat\": \"column\"}}, \"y\": {\"type\": \"quantitative\", \"field\": {\"repeat\": \"row\"}}}, \"height\": 100, \"selection\": {\"selector098\": {\"type\": \"interval\", \"bind\": \"scales\", \"encodings\": [\"x\", \"y\"]}}, \"width\": 100}, \"$schema\": \"https://vega.github.io/schema/vega-lite/v4.0.2.json\", \"datasets\": {\"data-f02450ab61490a1363517a0190416235\": [{\"Name\": \"chevrolet chevelle malibu\", \"Miles_per_Gallon\": 18.0, \"Cylinders\": 8, \"Displacement\": 307.0, \"Horsepower\": 130.0, \"Weight_in_lbs\": 3504, \"Acceleration\": 12.0, \"Year\": \"1970-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"buick skylark 320\", \"Miles_per_Gallon\": 15.0, \"Cylinders\": 8, \"Displacement\": 350.0, \"Horsepower\": 165.0, \"Weight_in_lbs\": 3693, \"Acceleration\": 11.5, \"Year\": \"1970-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"plymouth satellite\", \"Miles_per_Gallon\": 18.0, \"Cylinders\": 8, \"Displacement\": 318.0, \"Horsepower\": 150.0, \"Weight_in_lbs\": 3436, \"Acceleration\": 11.0, \"Year\": \"1970-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"amc rebel sst\", \"Miles_per_Gallon\": 16.0, \"Cylinders\": 8, \"Displacement\": 304.0, \"Horsepower\": 150.0, \"Weight_in_lbs\": 3433, \"Acceleration\": 12.0, \"Year\": \"1970-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"ford torino\", \"Miles_per_Gallon\": 17.0, \"Cylinders\": 8, \"Displacement\": 302.0, \"Horsepower\": 140.0, \"Weight_in_lbs\": 3449, \"Acceleration\": 10.5, \"Year\": \"1970-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"ford galaxie 500\", \"Miles_per_Gallon\": 15.0, \"Cylinders\": 8, \"Displacement\": 429.0, \"Horsepower\": 198.0, \"Weight_in_lbs\": 4341, \"Acceleration\": 10.0, \"Year\": \"1970-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"chevrolet impala\", \"Miles_per_Gallon\": 14.0, \"Cylinders\": 8, \"Displacement\": 454.0, \"Horsepower\": 220.0, \"Weight_in_lbs\": 4354, \"Acceleration\": 9.0, \"Year\": \"1970-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"plymouth fury iii\", \"Miles_per_Gallon\": 14.0, \"Cylinders\": 8, \"Displacement\": 440.0, \"Horsepower\": 215.0, \"Weight_in_lbs\": 4312, \"Acceleration\": 8.5, \"Year\": \"1970-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"pontiac catalina\", \"Miles_per_Gallon\": 14.0, \"Cylinders\": 8, \"Displacement\": 455.0, \"Horsepower\": 225.0, \"Weight_in_lbs\": 4425, \"Acceleration\": 10.0, \"Year\": \"1970-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"amc ambassador dpl\", \"Miles_per_Gallon\": 15.0, \"Cylinders\": 8, \"Displacement\": 390.0, \"Horsepower\": 190.0, \"Weight_in_lbs\": 3850, \"Acceleration\": 8.5, \"Year\": \"1970-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"citroen ds-21 pallas\", \"Miles_per_Gallon\": null, \"Cylinders\": 4, \"Displacement\": 133.0, \"Horsepower\": 115.0, \"Weight_in_lbs\": 3090, \"Acceleration\": 17.5, \"Year\": \"1970-01-01T00:00:00\", \"Origin\": \"Europe\"}, {\"Name\": \"chevrolet chevelle concours (sw)\", \"Miles_per_Gallon\": null, \"Cylinders\": 8, \"Displacement\": 350.0, \"Horsepower\": 165.0, \"Weight_in_lbs\": 4142, \"Acceleration\": 11.5, \"Year\": \"1970-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"ford torino (sw)\", \"Miles_per_Gallon\": null, \"Cylinders\": 8, \"Displacement\": 351.0, \"Horsepower\": 153.0, \"Weight_in_lbs\": 4034, \"Acceleration\": 11.0, \"Year\": \"1970-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"plymouth satellite (sw)\", \"Miles_per_Gallon\": null, \"Cylinders\": 8, \"Displacement\": 383.0, \"Horsepower\": 175.0, \"Weight_in_lbs\": 4166, \"Acceleration\": 10.5, \"Year\": \"1970-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"amc rebel sst (sw)\", \"Miles_per_Gallon\": null, \"Cylinders\": 8, \"Displacement\": 360.0, \"Horsepower\": 175.0, \"Weight_in_lbs\": 3850, \"Acceleration\": 11.0, \"Year\": \"1970-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"dodge challenger se\", \"Miles_per_Gallon\": 15.0, \"Cylinders\": 8, \"Displacement\": 383.0, \"Horsepower\": 170.0, \"Weight_in_lbs\": 3563, \"Acceleration\": 10.0, \"Year\": \"1970-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"plymouth 'cuda 340\", \"Miles_per_Gallon\": 14.0, \"Cylinders\": 8, \"Displacement\": 340.0, \"Horsepower\": 160.0, \"Weight_in_lbs\": 3609, \"Acceleration\": 8.0, \"Year\": \"1970-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"ford mustang boss 302\", \"Miles_per_Gallon\": null, \"Cylinders\": 8, \"Displacement\": 302.0, \"Horsepower\": 140.0, \"Weight_in_lbs\": 3353, \"Acceleration\": 8.0, \"Year\": \"1970-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"chevrolet monte carlo\", \"Miles_per_Gallon\": 15.0, \"Cylinders\": 8, \"Displacement\": 400.0, \"Horsepower\": 150.0, \"Weight_in_lbs\": 3761, \"Acceleration\": 9.5, \"Year\": \"1970-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"buick estate wagon (sw)\", \"Miles_per_Gallon\": 14.0, \"Cylinders\": 8, \"Displacement\": 455.0, \"Horsepower\": 225.0, \"Weight_in_lbs\": 3086, \"Acceleration\": 10.0, \"Year\": \"1970-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"toyota corona mark ii\", \"Miles_per_Gallon\": 24.0, \"Cylinders\": 4, \"Displacement\": 113.0, \"Horsepower\": 95.0, \"Weight_in_lbs\": 2372, \"Acceleration\": 15.0, \"Year\": \"1970-01-01T00:00:00\", \"Origin\": \"Japan\"}, {\"Name\": \"plymouth duster\", \"Miles_per_Gallon\": 22.0, \"Cylinders\": 6, \"Displacement\": 198.0, \"Horsepower\": 95.0, \"Weight_in_lbs\": 2833, \"Acceleration\": 15.5, \"Year\": \"1970-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"amc hornet\", \"Miles_per_Gallon\": 18.0, \"Cylinders\": 6, \"Displacement\": 199.0, \"Horsepower\": 97.0, \"Weight_in_lbs\": 2774, \"Acceleration\": 15.5, \"Year\": \"1970-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"ford maverick\", \"Miles_per_Gallon\": 21.0, \"Cylinders\": 6, \"Displacement\": 200.0, \"Horsepower\": 85.0, \"Weight_in_lbs\": 2587, \"Acceleration\": 16.0, \"Year\": \"1970-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"datsun pl510\", \"Miles_per_Gallon\": 27.0, \"Cylinders\": 4, \"Displacement\": 97.0, \"Horsepower\": 88.0, \"Weight_in_lbs\": 2130, \"Acceleration\": 14.5, \"Year\": \"1970-01-01T00:00:00\", \"Origin\": \"Japan\"}, {\"Name\": \"volkswagen 1131 deluxe sedan\", \"Miles_per_Gallon\": 26.0, \"Cylinders\": 4, \"Displacement\": 97.0, \"Horsepower\": 46.0, \"Weight_in_lbs\": 1835, \"Acceleration\": 20.5, \"Year\": \"1970-01-01T00:00:00\", \"Origin\": \"Europe\"}, {\"Name\": \"peugeot 504\", \"Miles_per_Gallon\": 25.0, \"Cylinders\": 4, \"Displacement\": 110.0, \"Horsepower\": 87.0, \"Weight_in_lbs\": 2672, \"Acceleration\": 17.5, \"Year\": \"1970-01-01T00:00:00\", \"Origin\": \"Europe\"}, {\"Name\": \"audi 100 ls\", \"Miles_per_Gallon\": 24.0, \"Cylinders\": 4, \"Displacement\": 107.0, \"Horsepower\": 90.0, \"Weight_in_lbs\": 2430, \"Acceleration\": 14.5, \"Year\": \"1970-01-01T00:00:00\", \"Origin\": \"Europe\"}, {\"Name\": \"saab 99e\", \"Miles_per_Gallon\": 25.0, \"Cylinders\": 4, \"Displacement\": 104.0, \"Horsepower\": 95.0, \"Weight_in_lbs\": 2375, \"Acceleration\": 17.5, \"Year\": \"1970-01-01T00:00:00\", \"Origin\": \"Europe\"}, {\"Name\": \"bmw 2002\", \"Miles_per_Gallon\": 26.0, \"Cylinders\": 4, \"Displacement\": 121.0, \"Horsepower\": 113.0, \"Weight_in_lbs\": 2234, \"Acceleration\": 12.5, \"Year\": \"1970-01-01T00:00:00\", \"Origin\": \"Europe\"}, {\"Name\": \"amc gremlin\", \"Miles_per_Gallon\": 21.0, \"Cylinders\": 6, \"Displacement\": 199.0, \"Horsepower\": 90.0, \"Weight_in_lbs\": 2648, \"Acceleration\": 15.0, \"Year\": \"1970-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"ford f250\", \"Miles_per_Gallon\": 10.0, \"Cylinders\": 8, \"Displacement\": 360.0, \"Horsepower\": 215.0, \"Weight_in_lbs\": 4615, \"Acceleration\": 14.0, \"Year\": \"1970-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"chevy c20\", \"Miles_per_Gallon\": 10.0, \"Cylinders\": 8, \"Displacement\": 307.0, \"Horsepower\": 200.0, \"Weight_in_lbs\": 4376, \"Acceleration\": 15.0, \"Year\": \"1970-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"dodge d200\", \"Miles_per_Gallon\": 11.0, \"Cylinders\": 8, \"Displacement\": 318.0, \"Horsepower\": 210.0, \"Weight_in_lbs\": 4382, \"Acceleration\": 13.5, \"Year\": \"1970-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"hi 1200d\", \"Miles_per_Gallon\": 9.0, \"Cylinders\": 8, \"Displacement\": 304.0, \"Horsepower\": 193.0, \"Weight_in_lbs\": 4732, \"Acceleration\": 18.5, \"Year\": \"1970-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"datsun pl510\", \"Miles_per_Gallon\": 27.0, \"Cylinders\": 4, \"Displacement\": 97.0, \"Horsepower\": 88.0, \"Weight_in_lbs\": 2130, \"Acceleration\": 14.5, \"Year\": \"1971-01-01T00:00:00\", \"Origin\": \"Japan\"}, {\"Name\": \"chevrolet vega 2300\", \"Miles_per_Gallon\": 28.0, \"Cylinders\": 4, \"Displacement\": 140.0, \"Horsepower\": 90.0, \"Weight_in_lbs\": 2264, \"Acceleration\": 15.5, \"Year\": \"1971-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"toyota corona\", \"Miles_per_Gallon\": 25.0, \"Cylinders\": 4, \"Displacement\": 113.0, \"Horsepower\": 95.0, \"Weight_in_lbs\": 2228, \"Acceleration\": 14.0, \"Year\": \"1971-01-01T00:00:00\", \"Origin\": \"Japan\"}, {\"Name\": \"ford pinto\", \"Miles_per_Gallon\": 25.0, \"Cylinders\": 4, \"Displacement\": 98.0, \"Horsepower\": null, \"Weight_in_lbs\": 2046, \"Acceleration\": 19.0, \"Year\": \"1971-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"volkswagen super beetle 117\", \"Miles_per_Gallon\": null, \"Cylinders\": 4, \"Displacement\": 97.0, \"Horsepower\": 48.0, \"Weight_in_lbs\": 1978, \"Acceleration\": 20.0, \"Year\": \"1971-01-01T00:00:00\", \"Origin\": \"Europe\"}, {\"Name\": \"amc gremlin\", \"Miles_per_Gallon\": 19.0, \"Cylinders\": 6, \"Displacement\": 232.0, \"Horsepower\": 100.0, \"Weight_in_lbs\": 2634, \"Acceleration\": 13.0, \"Year\": \"1971-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"plymouth satellite custom\", \"Miles_per_Gallon\": 16.0, \"Cylinders\": 6, \"Displacement\": 225.0, \"Horsepower\": 105.0, \"Weight_in_lbs\": 3439, \"Acceleration\": 15.5, \"Year\": \"1971-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"chevrolet chevelle malibu\", \"Miles_per_Gallon\": 17.0, \"Cylinders\": 6, \"Displacement\": 250.0, \"Horsepower\": 100.0, \"Weight_in_lbs\": 3329, \"Acceleration\": 15.5, \"Year\": \"1971-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"ford torino 500\", \"Miles_per_Gallon\": 19.0, \"Cylinders\": 6, \"Displacement\": 250.0, \"Horsepower\": 88.0, \"Weight_in_lbs\": 3302, \"Acceleration\": 15.5, \"Year\": \"1971-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"amc matador\", \"Miles_per_Gallon\": 18.0, \"Cylinders\": 6, \"Displacement\": 232.0, \"Horsepower\": 100.0, \"Weight_in_lbs\": 3288, \"Acceleration\": 15.5, \"Year\": \"1971-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"chevrolet impala\", \"Miles_per_Gallon\": 14.0, \"Cylinders\": 8, \"Displacement\": 350.0, \"Horsepower\": 165.0, \"Weight_in_lbs\": 4209, \"Acceleration\": 12.0, \"Year\": \"1971-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"pontiac catalina brougham\", \"Miles_per_Gallon\": 14.0, \"Cylinders\": 8, \"Displacement\": 400.0, \"Horsepower\": 175.0, \"Weight_in_lbs\": 4464, \"Acceleration\": 11.5, \"Year\": \"1971-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"ford galaxie 500\", \"Miles_per_Gallon\": 14.0, \"Cylinders\": 8, \"Displacement\": 351.0, \"Horsepower\": 153.0, \"Weight_in_lbs\": 4154, \"Acceleration\": 13.5, \"Year\": \"1971-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"plymouth fury iii\", \"Miles_per_Gallon\": 14.0, \"Cylinders\": 8, \"Displacement\": 318.0, \"Horsepower\": 150.0, \"Weight_in_lbs\": 4096, \"Acceleration\": 13.0, \"Year\": \"1971-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"dodge monaco (sw)\", \"Miles_per_Gallon\": 12.0, \"Cylinders\": 8, \"Displacement\": 383.0, \"Horsepower\": 180.0, \"Weight_in_lbs\": 4955, \"Acceleration\": 11.5, \"Year\": \"1971-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"ford country squire (sw)\", \"Miles_per_Gallon\": 13.0, \"Cylinders\": 8, \"Displacement\": 400.0, \"Horsepower\": 170.0, \"Weight_in_lbs\": 4746, \"Acceleration\": 12.0, \"Year\": \"1971-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"pontiac safari (sw)\", \"Miles_per_Gallon\": 13.0, \"Cylinders\": 8, \"Displacement\": 400.0, \"Horsepower\": 175.0, \"Weight_in_lbs\": 5140, \"Acceleration\": 12.0, \"Year\": \"1971-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"amc hornet sportabout (sw)\", \"Miles_per_Gallon\": 18.0, \"Cylinders\": 6, \"Displacement\": 258.0, \"Horsepower\": 110.0, \"Weight_in_lbs\": 2962, \"Acceleration\": 13.5, \"Year\": \"1971-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"chevrolet vega (sw)\", \"Miles_per_Gallon\": 22.0, \"Cylinders\": 4, \"Displacement\": 140.0, \"Horsepower\": 72.0, \"Weight_in_lbs\": 2408, \"Acceleration\": 19.0, \"Year\": \"1971-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"pontiac firebird\", \"Miles_per_Gallon\": 19.0, \"Cylinders\": 6, \"Displacement\": 250.0, \"Horsepower\": 100.0, \"Weight_in_lbs\": 3282, \"Acceleration\": 15.0, \"Year\": \"1971-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"ford mustang\", \"Miles_per_Gallon\": 18.0, \"Cylinders\": 6, \"Displacement\": 250.0, \"Horsepower\": 88.0, \"Weight_in_lbs\": 3139, \"Acceleration\": 14.5, \"Year\": \"1971-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"mercury capri 2000\", \"Miles_per_Gallon\": 23.0, \"Cylinders\": 4, \"Displacement\": 122.0, \"Horsepower\": 86.0, \"Weight_in_lbs\": 2220, \"Acceleration\": 14.0, \"Year\": \"1971-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"opel 1900\", \"Miles_per_Gallon\": 28.0, \"Cylinders\": 4, \"Displacement\": 116.0, \"Horsepower\": 90.0, \"Weight_in_lbs\": 2123, \"Acceleration\": 14.0, \"Year\": \"1971-01-01T00:00:00\", \"Origin\": \"Europe\"}, {\"Name\": \"peugeot 304\", \"Miles_per_Gallon\": 30.0, \"Cylinders\": 4, \"Displacement\": 79.0, \"Horsepower\": 70.0, \"Weight_in_lbs\": 2074, \"Acceleration\": 19.5, \"Year\": \"1971-01-01T00:00:00\", \"Origin\": \"Europe\"}, {\"Name\": \"fiat 124b\", \"Miles_per_Gallon\": 30.0, \"Cylinders\": 4, \"Displacement\": 88.0, \"Horsepower\": 76.0, \"Weight_in_lbs\": 2065, \"Acceleration\": 14.5, \"Year\": \"1971-01-01T00:00:00\", \"Origin\": \"Europe\"}, {\"Name\": \"toyota corolla 1200\", \"Miles_per_Gallon\": 31.0, \"Cylinders\": 4, \"Displacement\": 71.0, \"Horsepower\": 65.0, \"Weight_in_lbs\": 1773, \"Acceleration\": 19.0, \"Year\": \"1971-01-01T00:00:00\", \"Origin\": \"Japan\"}, {\"Name\": \"datsun 1200\", \"Miles_per_Gallon\": 35.0, \"Cylinders\": 4, \"Displacement\": 72.0, \"Horsepower\": 69.0, \"Weight_in_lbs\": 1613, \"Acceleration\": 18.0, \"Year\": \"1971-01-01T00:00:00\", \"Origin\": \"Japan\"}, {\"Name\": \"volkswagen model 111\", \"Miles_per_Gallon\": 27.0, \"Cylinders\": 4, \"Displacement\": 97.0, \"Horsepower\": 60.0, \"Weight_in_lbs\": 1834, \"Acceleration\": 19.0, \"Year\": \"1971-01-01T00:00:00\", \"Origin\": \"Europe\"}, {\"Name\": \"plymouth cricket\", \"Miles_per_Gallon\": 26.0, \"Cylinders\": 4, \"Displacement\": 91.0, \"Horsepower\": 70.0, \"Weight_in_lbs\": 1955, \"Acceleration\": 20.5, \"Year\": \"1971-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"toyota corona hardtop\", \"Miles_per_Gallon\": 24.0, \"Cylinders\": 4, \"Displacement\": 113.0, \"Horsepower\": 95.0, \"Weight_in_lbs\": 2278, \"Acceleration\": 15.5, \"Year\": \"1972-01-01T00:00:00\", \"Origin\": \"Japan\"}, {\"Name\": \"dodge colt hardtop\", \"Miles_per_Gallon\": 25.0, \"Cylinders\": 4, \"Displacement\": 97.5, \"Horsepower\": 80.0, \"Weight_in_lbs\": 2126, \"Acceleration\": 17.0, \"Year\": \"1972-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"volkswagen type 3\", \"Miles_per_Gallon\": 23.0, \"Cylinders\": 4, \"Displacement\": 97.0, \"Horsepower\": 54.0, \"Weight_in_lbs\": 2254, \"Acceleration\": 23.5, \"Year\": \"1972-01-01T00:00:00\", \"Origin\": \"Europe\"}, {\"Name\": \"chevrolet vega\", \"Miles_per_Gallon\": 20.0, \"Cylinders\": 4, \"Displacement\": 140.0, \"Horsepower\": 90.0, \"Weight_in_lbs\": 2408, \"Acceleration\": 19.5, \"Year\": \"1972-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"ford pinto runabout\", \"Miles_per_Gallon\": 21.0, \"Cylinders\": 4, \"Displacement\": 122.0, \"Horsepower\": 86.0, \"Weight_in_lbs\": 2226, \"Acceleration\": 16.5, \"Year\": \"1972-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"chevrolet impala\", \"Miles_per_Gallon\": 13.0, \"Cylinders\": 8, \"Displacement\": 350.0, \"Horsepower\": 165.0, \"Weight_in_lbs\": 4274, \"Acceleration\": 12.0, \"Year\": \"1972-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"pontiac catalina\", \"Miles_per_Gallon\": 14.0, \"Cylinders\": 8, \"Displacement\": 400.0, \"Horsepower\": 175.0, \"Weight_in_lbs\": 4385, \"Acceleration\": 12.0, \"Year\": \"1972-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"plymouth fury iii\", \"Miles_per_Gallon\": 15.0, \"Cylinders\": 8, \"Displacement\": 318.0, \"Horsepower\": 150.0, \"Weight_in_lbs\": 4135, \"Acceleration\": 13.5, \"Year\": \"1972-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"ford galaxie 500\", \"Miles_per_Gallon\": 14.0, \"Cylinders\": 8, \"Displacement\": 351.0, \"Horsepower\": 153.0, \"Weight_in_lbs\": 4129, \"Acceleration\": 13.0, \"Year\": \"1972-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"amc ambassador sst\", \"Miles_per_Gallon\": 17.0, \"Cylinders\": 8, \"Displacement\": 304.0, \"Horsepower\": 150.0, \"Weight_in_lbs\": 3672, \"Acceleration\": 11.5, \"Year\": \"1972-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"mercury marquis\", \"Miles_per_Gallon\": 11.0, \"Cylinders\": 8, \"Displacement\": 429.0, \"Horsepower\": 208.0, \"Weight_in_lbs\": 4633, \"Acceleration\": 11.0, \"Year\": \"1972-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"buick lesabre custom\", \"Miles_per_Gallon\": 13.0, \"Cylinders\": 8, \"Displacement\": 350.0, \"Horsepower\": 155.0, \"Weight_in_lbs\": 4502, \"Acceleration\": 13.5, \"Year\": \"1972-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"oldsmobile delta 88 royale\", \"Miles_per_Gallon\": 12.0, \"Cylinders\": 8, \"Displacement\": 350.0, \"Horsepower\": 160.0, \"Weight_in_lbs\": 4456, \"Acceleration\": 13.5, \"Year\": \"1972-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"chrysler newport royal\", \"Miles_per_Gallon\": 13.0, \"Cylinders\": 8, \"Displacement\": 400.0, \"Horsepower\": 190.0, \"Weight_in_lbs\": 4422, \"Acceleration\": 12.5, \"Year\": \"1972-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"mazda rx2 coupe\", \"Miles_per_Gallon\": 19.0, \"Cylinders\": 3, \"Displacement\": 70.0, \"Horsepower\": 97.0, \"Weight_in_lbs\": 2330, \"Acceleration\": 13.5, \"Year\": \"1972-01-01T00:00:00\", \"Origin\": \"Japan\"}, {\"Name\": \"amc matador (sw)\", \"Miles_per_Gallon\": 15.0, \"Cylinders\": 8, \"Displacement\": 304.0, \"Horsepower\": 150.0, \"Weight_in_lbs\": 3892, \"Acceleration\": 12.5, \"Year\": \"1972-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"chevrolet chevelle concours (sw)\", \"Miles_per_Gallon\": 13.0, \"Cylinders\": 8, \"Displacement\": 307.0, \"Horsepower\": 130.0, \"Weight_in_lbs\": 4098, \"Acceleration\": 14.0, \"Year\": \"1972-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"ford gran torino (sw)\", \"Miles_per_Gallon\": 13.0, \"Cylinders\": 8, \"Displacement\": 302.0, \"Horsepower\": 140.0, \"Weight_in_lbs\": 4294, \"Acceleration\": 16.0, \"Year\": \"1972-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"plymouth satellite custom (sw)\", \"Miles_per_Gallon\": 14.0, \"Cylinders\": 8, \"Displacement\": 318.0, \"Horsepower\": 150.0, \"Weight_in_lbs\": 4077, \"Acceleration\": 14.0, \"Year\": \"1972-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"volvo 145e (sw)\", \"Miles_per_Gallon\": 18.0, \"Cylinders\": 4, \"Displacement\": 121.0, \"Horsepower\": 112.0, \"Weight_in_lbs\": 2933, \"Acceleration\": 14.5, \"Year\": \"1972-01-01T00:00:00\", \"Origin\": \"Europe\"}, {\"Name\": \"volkswagen 411 (sw)\", \"Miles_per_Gallon\": 22.0, \"Cylinders\": 4, \"Displacement\": 121.0, \"Horsepower\": 76.0, \"Weight_in_lbs\": 2511, \"Acceleration\": 18.0, \"Year\": \"1972-01-01T00:00:00\", \"Origin\": \"Europe\"}, {\"Name\": \"peugeot 504 (sw)\", \"Miles_per_Gallon\": 21.0, \"Cylinders\": 4, \"Displacement\": 120.0, \"Horsepower\": 87.0, \"Weight_in_lbs\": 2979, \"Acceleration\": 19.5, \"Year\": \"1972-01-01T00:00:00\", \"Origin\": \"Europe\"}, {\"Name\": \"renault 12 (sw)\", \"Miles_per_Gallon\": 26.0, \"Cylinders\": 4, \"Displacement\": 96.0, \"Horsepower\": 69.0, \"Weight_in_lbs\": 2189, \"Acceleration\": 18.0, \"Year\": \"1972-01-01T00:00:00\", \"Origin\": \"Europe\"}, {\"Name\": \"ford pinto (sw)\", \"Miles_per_Gallon\": 22.0, \"Cylinders\": 4, \"Displacement\": 122.0, \"Horsepower\": 86.0, \"Weight_in_lbs\": 2395, \"Acceleration\": 16.0, \"Year\": \"1972-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"datsun 510 (sw)\", \"Miles_per_Gallon\": 28.0, \"Cylinders\": 4, \"Displacement\": 97.0, \"Horsepower\": 92.0, \"Weight_in_lbs\": 2288, \"Acceleration\": 17.0, \"Year\": \"1972-01-01T00:00:00\", \"Origin\": \"Japan\"}, {\"Name\": \"toyouta corona mark ii (sw)\", \"Miles_per_Gallon\": 23.0, \"Cylinders\": 4, \"Displacement\": 120.0, \"Horsepower\": 97.0, \"Weight_in_lbs\": 2506, \"Acceleration\": 14.5, \"Year\": \"1972-01-01T00:00:00\", \"Origin\": \"Japan\"}, {\"Name\": \"dodge colt (sw)\", \"Miles_per_Gallon\": 28.0, \"Cylinders\": 4, \"Displacement\": 98.0, \"Horsepower\": 80.0, \"Weight_in_lbs\": 2164, \"Acceleration\": 15.0, \"Year\": \"1972-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"toyota corolla 1600 (sw)\", \"Miles_per_Gallon\": 27.0, \"Cylinders\": 4, \"Displacement\": 97.0, \"Horsepower\": 88.0, \"Weight_in_lbs\": 2100, \"Acceleration\": 16.5, \"Year\": \"1972-01-01T00:00:00\", \"Origin\": \"Japan\"}, {\"Name\": \"buick century 350\", \"Miles_per_Gallon\": 13.0, \"Cylinders\": 8, \"Displacement\": 350.0, \"Horsepower\": 175.0, \"Weight_in_lbs\": 4100, \"Acceleration\": 13.0, \"Year\": \"1973-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"amc matador\", \"Miles_per_Gallon\": 14.0, \"Cylinders\": 8, \"Displacement\": 304.0, \"Horsepower\": 150.0, \"Weight_in_lbs\": 3672, \"Acceleration\": 11.5, \"Year\": \"1973-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"chevrolet malibu\", \"Miles_per_Gallon\": 13.0, \"Cylinders\": 8, \"Displacement\": 350.0, \"Horsepower\": 145.0, \"Weight_in_lbs\": 3988, \"Acceleration\": 13.0, \"Year\": \"1973-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"ford gran torino\", \"Miles_per_Gallon\": 14.0, \"Cylinders\": 8, \"Displacement\": 302.0, \"Horsepower\": 137.0, \"Weight_in_lbs\": 4042, \"Acceleration\": 14.5, \"Year\": \"1973-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"dodge coronet custom\", \"Miles_per_Gallon\": 15.0, \"Cylinders\": 8, \"Displacement\": 318.0, \"Horsepower\": 150.0, \"Weight_in_lbs\": 3777, \"Acceleration\": 12.5, \"Year\": \"1973-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"mercury marquis brougham\", \"Miles_per_Gallon\": 12.0, \"Cylinders\": 8, \"Displacement\": 429.0, \"Horsepower\": 198.0, \"Weight_in_lbs\": 4952, \"Acceleration\": 11.5, \"Year\": \"1973-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"chevrolet caprice classic\", \"Miles_per_Gallon\": 13.0, \"Cylinders\": 8, \"Displacement\": 400.0, \"Horsepower\": 150.0, \"Weight_in_lbs\": 4464, \"Acceleration\": 12.0, \"Year\": \"1973-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"ford ltd\", \"Miles_per_Gallon\": 13.0, \"Cylinders\": 8, \"Displacement\": 351.0, \"Horsepower\": 158.0, \"Weight_in_lbs\": 4363, \"Acceleration\": 13.0, \"Year\": \"1973-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"plymouth fury gran sedan\", \"Miles_per_Gallon\": 14.0, \"Cylinders\": 8, \"Displacement\": 318.0, \"Horsepower\": 150.0, \"Weight_in_lbs\": 4237, \"Acceleration\": 14.5, \"Year\": \"1973-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"chrysler new yorker brougham\", \"Miles_per_Gallon\": 13.0, \"Cylinders\": 8, \"Displacement\": 440.0, \"Horsepower\": 215.0, \"Weight_in_lbs\": 4735, \"Acceleration\": 11.0, \"Year\": \"1973-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"buick electra 225 custom\", \"Miles_per_Gallon\": 12.0, \"Cylinders\": 8, \"Displacement\": 455.0, \"Horsepower\": 225.0, \"Weight_in_lbs\": 4951, \"Acceleration\": 11.0, \"Year\": \"1973-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"amc ambassador brougham\", \"Miles_per_Gallon\": 13.0, \"Cylinders\": 8, \"Displacement\": 360.0, \"Horsepower\": 175.0, \"Weight_in_lbs\": 3821, \"Acceleration\": 11.0, \"Year\": \"1973-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"plymouth valiant\", \"Miles_per_Gallon\": 18.0, \"Cylinders\": 6, \"Displacement\": 225.0, \"Horsepower\": 105.0, \"Weight_in_lbs\": 3121, \"Acceleration\": 16.5, \"Year\": \"1973-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"chevrolet nova custom\", \"Miles_per_Gallon\": 16.0, \"Cylinders\": 6, \"Displacement\": 250.0, \"Horsepower\": 100.0, \"Weight_in_lbs\": 3278, \"Acceleration\": 18.0, \"Year\": \"1973-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"amc hornet\", \"Miles_per_Gallon\": 18.0, \"Cylinders\": 6, \"Displacement\": 232.0, \"Horsepower\": 100.0, \"Weight_in_lbs\": 2945, \"Acceleration\": 16.0, \"Year\": \"1973-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"ford maverick\", \"Miles_per_Gallon\": 18.0, \"Cylinders\": 6, \"Displacement\": 250.0, \"Horsepower\": 88.0, \"Weight_in_lbs\": 3021, \"Acceleration\": 16.5, \"Year\": \"1973-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"plymouth duster\", \"Miles_per_Gallon\": 23.0, \"Cylinders\": 6, \"Displacement\": 198.0, \"Horsepower\": 95.0, \"Weight_in_lbs\": 2904, \"Acceleration\": 16.0, \"Year\": \"1973-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"volkswagen super beetle\", \"Miles_per_Gallon\": 26.0, \"Cylinders\": 4, \"Displacement\": 97.0, \"Horsepower\": 46.0, \"Weight_in_lbs\": 1950, \"Acceleration\": 21.0, \"Year\": \"1973-01-01T00:00:00\", \"Origin\": \"Europe\"}, {\"Name\": \"chevrolet impala\", \"Miles_per_Gallon\": 11.0, \"Cylinders\": 8, \"Displacement\": 400.0, \"Horsepower\": 150.0, \"Weight_in_lbs\": 4997, \"Acceleration\": 14.0, \"Year\": \"1973-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"ford country\", \"Miles_per_Gallon\": 12.0, \"Cylinders\": 8, \"Displacement\": 400.0, \"Horsepower\": 167.0, \"Weight_in_lbs\": 4906, \"Acceleration\": 12.5, \"Year\": \"1973-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"plymouth custom suburb\", \"Miles_per_Gallon\": 13.0, \"Cylinders\": 8, \"Displacement\": 360.0, \"Horsepower\": 170.0, \"Weight_in_lbs\": 4654, \"Acceleration\": 13.0, \"Year\": \"1973-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"oldsmobile vista cruiser\", \"Miles_per_Gallon\": 12.0, \"Cylinders\": 8, \"Displacement\": 350.0, \"Horsepower\": 180.0, \"Weight_in_lbs\": 4499, \"Acceleration\": 12.5, \"Year\": \"1973-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"amc gremlin\", \"Miles_per_Gallon\": 18.0, \"Cylinders\": 6, \"Displacement\": 232.0, \"Horsepower\": 100.0, \"Weight_in_lbs\": 2789, \"Acceleration\": 15.0, \"Year\": \"1973-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"toyota carina\", \"Miles_per_Gallon\": 20.0, \"Cylinders\": 4, \"Displacement\": 97.0, \"Horsepower\": 88.0, \"Weight_in_lbs\": 2279, \"Acceleration\": 19.0, \"Year\": \"1973-01-01T00:00:00\", \"Origin\": \"Japan\"}, {\"Name\": \"chevrolet vega\", \"Miles_per_Gallon\": 21.0, \"Cylinders\": 4, \"Displacement\": 140.0, \"Horsepower\": 72.0, \"Weight_in_lbs\": 2401, \"Acceleration\": 19.5, \"Year\": \"1973-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"datsun 610\", \"Miles_per_Gallon\": 22.0, \"Cylinders\": 4, \"Displacement\": 108.0, \"Horsepower\": 94.0, \"Weight_in_lbs\": 2379, \"Acceleration\": 16.5, \"Year\": \"1973-01-01T00:00:00\", \"Origin\": \"Japan\"}, {\"Name\": \"maxda rx3\", \"Miles_per_Gallon\": 18.0, \"Cylinders\": 3, \"Displacement\": 70.0, \"Horsepower\": 90.0, \"Weight_in_lbs\": 2124, \"Acceleration\": 13.5, \"Year\": \"1973-01-01T00:00:00\", \"Origin\": \"Japan\"}, {\"Name\": \"ford pinto\", \"Miles_per_Gallon\": 19.0, \"Cylinders\": 4, \"Displacement\": 122.0, \"Horsepower\": 85.0, \"Weight_in_lbs\": 2310, \"Acceleration\": 18.5, \"Year\": \"1973-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"mercury capri v6\", \"Miles_per_Gallon\": 21.0, \"Cylinders\": 6, \"Displacement\": 155.0, \"Horsepower\": 107.0, \"Weight_in_lbs\": 2472, \"Acceleration\": 14.0, \"Year\": \"1973-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"fiat 124 sport coupe\", \"Miles_per_Gallon\": 26.0, \"Cylinders\": 4, \"Displacement\": 98.0, \"Horsepower\": 90.0, \"Weight_in_lbs\": 2265, \"Acceleration\": 15.5, \"Year\": \"1973-01-01T00:00:00\", \"Origin\": \"Europe\"}, {\"Name\": \"chevrolet monte carlo s\", \"Miles_per_Gallon\": 15.0, \"Cylinders\": 8, \"Displacement\": 350.0, \"Horsepower\": 145.0, \"Weight_in_lbs\": 4082, \"Acceleration\": 13.0, \"Year\": \"1973-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"pontiac grand prix\", \"Miles_per_Gallon\": 16.0, \"Cylinders\": 8, \"Displacement\": 400.0, \"Horsepower\": 230.0, \"Weight_in_lbs\": 4278, \"Acceleration\": 9.5, \"Year\": \"1973-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"fiat 128\", \"Miles_per_Gallon\": 29.0, \"Cylinders\": 4, \"Displacement\": 68.0, \"Horsepower\": 49.0, \"Weight_in_lbs\": 1867, \"Acceleration\": 19.5, \"Year\": \"1973-01-01T00:00:00\", \"Origin\": \"Europe\"}, {\"Name\": \"opel manta\", \"Miles_per_Gallon\": 24.0, \"Cylinders\": 4, \"Displacement\": 116.0, \"Horsepower\": 75.0, \"Weight_in_lbs\": 2158, \"Acceleration\": 15.5, \"Year\": \"1973-01-01T00:00:00\", \"Origin\": \"Europe\"}, {\"Name\": \"audi 100ls\", \"Miles_per_Gallon\": 20.0, \"Cylinders\": 4, \"Displacement\": 114.0, \"Horsepower\": 91.0, \"Weight_in_lbs\": 2582, \"Acceleration\": 14.0, \"Year\": \"1973-01-01T00:00:00\", \"Origin\": \"Europe\"}, {\"Name\": \"volvo 144ea\", \"Miles_per_Gallon\": 19.0, \"Cylinders\": 4, \"Displacement\": 121.0, \"Horsepower\": 112.0, \"Weight_in_lbs\": 2868, \"Acceleration\": 15.5, \"Year\": \"1973-01-01T00:00:00\", \"Origin\": \"Europe\"}, {\"Name\": \"dodge dart custom\", \"Miles_per_Gallon\": 15.0, \"Cylinders\": 8, \"Displacement\": 318.0, \"Horsepower\": 150.0, \"Weight_in_lbs\": 3399, \"Acceleration\": 11.0, \"Year\": \"1973-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"saab 99le\", \"Miles_per_Gallon\": 24.0, \"Cylinders\": 4, \"Displacement\": 121.0, \"Horsepower\": 110.0, \"Weight_in_lbs\": 2660, \"Acceleration\": 14.0, \"Year\": \"1973-01-01T00:00:00\", \"Origin\": \"Europe\"}, {\"Name\": \"toyota mark ii\", \"Miles_per_Gallon\": 20.0, \"Cylinders\": 6, \"Displacement\": 156.0, \"Horsepower\": 122.0, \"Weight_in_lbs\": 2807, \"Acceleration\": 13.5, \"Year\": \"1973-01-01T00:00:00\", \"Origin\": \"Japan\"}, {\"Name\": \"oldsmobile omega\", \"Miles_per_Gallon\": 11.0, \"Cylinders\": 8, \"Displacement\": 350.0, \"Horsepower\": 180.0, \"Weight_in_lbs\": 3664, \"Acceleration\": 11.0, \"Year\": \"1973-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"plymouth duster\", \"Miles_per_Gallon\": 20.0, \"Cylinders\": 6, \"Displacement\": 198.0, \"Horsepower\": 95.0, \"Weight_in_lbs\": 3102, \"Acceleration\": 16.5, \"Year\": \"1974-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"ford maverick\", \"Miles_per_Gallon\": 21.0, \"Cylinders\": 6, \"Displacement\": 200.0, \"Horsepower\": null, \"Weight_in_lbs\": 2875, \"Acceleration\": 17.0, \"Year\": \"1974-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"amc hornet\", \"Miles_per_Gallon\": 19.0, \"Cylinders\": 6, \"Displacement\": 232.0, \"Horsepower\": 100.0, \"Weight_in_lbs\": 2901, \"Acceleration\": 16.0, \"Year\": \"1974-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"chevrolet nova\", \"Miles_per_Gallon\": 15.0, \"Cylinders\": 6, \"Displacement\": 250.0, \"Horsepower\": 100.0, \"Weight_in_lbs\": 3336, \"Acceleration\": 17.0, \"Year\": \"1974-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"datsun b210\", \"Miles_per_Gallon\": 31.0, \"Cylinders\": 4, \"Displacement\": 79.0, \"Horsepower\": 67.0, \"Weight_in_lbs\": 1950, \"Acceleration\": 19.0, \"Year\": \"1974-01-01T00:00:00\", \"Origin\": \"Japan\"}, {\"Name\": \"ford pinto\", \"Miles_per_Gallon\": 26.0, \"Cylinders\": 4, \"Displacement\": 122.0, \"Horsepower\": 80.0, \"Weight_in_lbs\": 2451, \"Acceleration\": 16.5, \"Year\": \"1974-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"toyota corolla 1200\", \"Miles_per_Gallon\": 32.0, \"Cylinders\": 4, \"Displacement\": 71.0, \"Horsepower\": 65.0, \"Weight_in_lbs\": 1836, \"Acceleration\": 21.0, \"Year\": \"1974-01-01T00:00:00\", \"Origin\": \"Japan\"}, {\"Name\": \"chevrolet vega\", \"Miles_per_Gallon\": 25.0, \"Cylinders\": 4, \"Displacement\": 140.0, \"Horsepower\": 75.0, \"Weight_in_lbs\": 2542, \"Acceleration\": 17.0, \"Year\": \"1974-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"chevrolet chevelle malibu classic\", \"Miles_per_Gallon\": 16.0, \"Cylinders\": 6, \"Displacement\": 250.0, \"Horsepower\": 100.0, \"Weight_in_lbs\": 3781, \"Acceleration\": 17.0, \"Year\": \"1974-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"amc matador\", \"Miles_per_Gallon\": 16.0, \"Cylinders\": 6, \"Displacement\": 258.0, \"Horsepower\": 110.0, \"Weight_in_lbs\": 3632, \"Acceleration\": 18.0, \"Year\": \"1974-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"plymouth satellite sebring\", \"Miles_per_Gallon\": 18.0, \"Cylinders\": 6, \"Displacement\": 225.0, \"Horsepower\": 105.0, \"Weight_in_lbs\": 3613, \"Acceleration\": 16.5, \"Year\": \"1974-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"ford gran torino\", \"Miles_per_Gallon\": 16.0, \"Cylinders\": 8, \"Displacement\": 302.0, \"Horsepower\": 140.0, \"Weight_in_lbs\": 4141, \"Acceleration\": 14.0, \"Year\": \"1974-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"buick century luxus (sw)\", \"Miles_per_Gallon\": 13.0, \"Cylinders\": 8, \"Displacement\": 350.0, \"Horsepower\": 150.0, \"Weight_in_lbs\": 4699, \"Acceleration\": 14.5, \"Year\": \"1974-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"dodge coronet custom (sw)\", \"Miles_per_Gallon\": 14.0, \"Cylinders\": 8, \"Displacement\": 318.0, \"Horsepower\": 150.0, \"Weight_in_lbs\": 4457, \"Acceleration\": 13.5, \"Year\": \"1974-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"ford gran torino (sw)\", \"Miles_per_Gallon\": 14.0, \"Cylinders\": 8, \"Displacement\": 302.0, \"Horsepower\": 140.0, \"Weight_in_lbs\": 4638, \"Acceleration\": 16.0, \"Year\": \"1974-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"amc matador (sw)\", \"Miles_per_Gallon\": 14.0, \"Cylinders\": 8, \"Displacement\": 304.0, \"Horsepower\": 150.0, \"Weight_in_lbs\": 4257, \"Acceleration\": 15.5, \"Year\": \"1974-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"audi fox\", \"Miles_per_Gallon\": 29.0, \"Cylinders\": 4, \"Displacement\": 98.0, \"Horsepower\": 83.0, \"Weight_in_lbs\": 2219, \"Acceleration\": 16.5, \"Year\": \"1974-01-01T00:00:00\", \"Origin\": \"Europe\"}, {\"Name\": \"volkswagen dasher\", \"Miles_per_Gallon\": 26.0, \"Cylinders\": 4, \"Displacement\": 79.0, \"Horsepower\": 67.0, \"Weight_in_lbs\": 1963, \"Acceleration\": 15.5, \"Year\": \"1974-01-01T00:00:00\", \"Origin\": \"Europe\"}, {\"Name\": \"opel manta\", \"Miles_per_Gallon\": 26.0, \"Cylinders\": 4, \"Displacement\": 97.0, \"Horsepower\": 78.0, \"Weight_in_lbs\": 2300, \"Acceleration\": 14.5, \"Year\": \"1974-01-01T00:00:00\", \"Origin\": \"Europe\"}, {\"Name\": \"toyota corona\", \"Miles_per_Gallon\": 31.0, \"Cylinders\": 4, \"Displacement\": 76.0, \"Horsepower\": 52.0, \"Weight_in_lbs\": 1649, \"Acceleration\": 16.5, \"Year\": \"1974-01-01T00:00:00\", \"Origin\": \"Japan\"}, {\"Name\": \"datsun 710\", \"Miles_per_Gallon\": 32.0, \"Cylinders\": 4, \"Displacement\": 83.0, \"Horsepower\": 61.0, \"Weight_in_lbs\": 2003, \"Acceleration\": 19.0, \"Year\": \"1974-01-01T00:00:00\", \"Origin\": \"Japan\"}, {\"Name\": \"dodge colt\", \"Miles_per_Gallon\": 28.0, \"Cylinders\": 4, \"Displacement\": 90.0, \"Horsepower\": 75.0, \"Weight_in_lbs\": 2125, \"Acceleration\": 14.5, \"Year\": \"1974-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"fiat 128\", \"Miles_per_Gallon\": 24.0, \"Cylinders\": 4, \"Displacement\": 90.0, \"Horsepower\": 75.0, \"Weight_in_lbs\": 2108, \"Acceleration\": 15.5, \"Year\": \"1974-01-01T00:00:00\", \"Origin\": \"Europe\"}, {\"Name\": \"fiat 124 tc\", \"Miles_per_Gallon\": 26.0, \"Cylinders\": 4, \"Displacement\": 116.0, \"Horsepower\": 75.0, \"Weight_in_lbs\": 2246, \"Acceleration\": 14.0, \"Year\": \"1974-01-01T00:00:00\", \"Origin\": \"Europe\"}, {\"Name\": \"honda civic\", \"Miles_per_Gallon\": 24.0, \"Cylinders\": 4, \"Displacement\": 120.0, \"Horsepower\": 97.0, \"Weight_in_lbs\": 2489, \"Acceleration\": 15.0, \"Year\": \"1974-01-01T00:00:00\", \"Origin\": \"Japan\"}, {\"Name\": \"subaru\", \"Miles_per_Gallon\": 26.0, \"Cylinders\": 4, \"Displacement\": 108.0, \"Horsepower\": 93.0, \"Weight_in_lbs\": 2391, \"Acceleration\": 15.5, \"Year\": \"1974-01-01T00:00:00\", \"Origin\": \"Japan\"}, {\"Name\": \"fiat x1.9\", \"Miles_per_Gallon\": 31.0, \"Cylinders\": 4, \"Displacement\": 79.0, \"Horsepower\": 67.0, \"Weight_in_lbs\": 2000, \"Acceleration\": 16.0, \"Year\": \"1974-01-01T00:00:00\", \"Origin\": \"Europe\"}, {\"Name\": \"plymouth valiant custom\", \"Miles_per_Gallon\": 19.0, \"Cylinders\": 6, \"Displacement\": 225.0, \"Horsepower\": 95.0, \"Weight_in_lbs\": 3264, \"Acceleration\": 16.0, \"Year\": \"1975-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"chevrolet nova\", \"Miles_per_Gallon\": 18.0, \"Cylinders\": 6, \"Displacement\": 250.0, \"Horsepower\": 105.0, \"Weight_in_lbs\": 3459, \"Acceleration\": 16.0, \"Year\": \"1975-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"mercury monarch\", \"Miles_per_Gallon\": 15.0, \"Cylinders\": 6, \"Displacement\": 250.0, \"Horsepower\": 72.0, \"Weight_in_lbs\": 3432, \"Acceleration\": 21.0, \"Year\": \"1975-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"ford maverick\", \"Miles_per_Gallon\": 15.0, \"Cylinders\": 6, \"Displacement\": 250.0, \"Horsepower\": 72.0, \"Weight_in_lbs\": 3158, \"Acceleration\": 19.5, \"Year\": \"1975-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"pontiac catalina\", \"Miles_per_Gallon\": 16.0, \"Cylinders\": 8, \"Displacement\": 400.0, \"Horsepower\": 170.0, \"Weight_in_lbs\": 4668, \"Acceleration\": 11.5, \"Year\": \"1975-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"chevrolet bel air\", \"Miles_per_Gallon\": 15.0, \"Cylinders\": 8, \"Displacement\": 350.0, \"Horsepower\": 145.0, \"Weight_in_lbs\": 4440, \"Acceleration\": 14.0, \"Year\": \"1975-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"plymouth grand fury\", \"Miles_per_Gallon\": 16.0, \"Cylinders\": 8, \"Displacement\": 318.0, \"Horsepower\": 150.0, \"Weight_in_lbs\": 4498, \"Acceleration\": 14.5, \"Year\": \"1975-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"ford ltd\", \"Miles_per_Gallon\": 14.0, \"Cylinders\": 8, \"Displacement\": 351.0, \"Horsepower\": 148.0, \"Weight_in_lbs\": 4657, \"Acceleration\": 13.5, \"Year\": \"1975-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"buick century\", \"Miles_per_Gallon\": 17.0, \"Cylinders\": 6, \"Displacement\": 231.0, \"Horsepower\": 110.0, \"Weight_in_lbs\": 3907, \"Acceleration\": 21.0, \"Year\": \"1975-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"chevroelt chevelle malibu\", \"Miles_per_Gallon\": 16.0, \"Cylinders\": 6, \"Displacement\": 250.0, \"Horsepower\": 105.0, \"Weight_in_lbs\": 3897, \"Acceleration\": 18.5, \"Year\": \"1975-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"amc matador\", \"Miles_per_Gallon\": 15.0, \"Cylinders\": 6, \"Displacement\": 258.0, \"Horsepower\": 110.0, \"Weight_in_lbs\": 3730, \"Acceleration\": 19.0, \"Year\": \"1975-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"plymouth fury\", \"Miles_per_Gallon\": 18.0, \"Cylinders\": 6, \"Displacement\": 225.0, \"Horsepower\": 95.0, \"Weight_in_lbs\": 3785, \"Acceleration\": 19.0, \"Year\": \"1975-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"buick skyhawk\", \"Miles_per_Gallon\": 21.0, \"Cylinders\": 6, \"Displacement\": 231.0, \"Horsepower\": 110.0, \"Weight_in_lbs\": 3039, \"Acceleration\": 15.0, \"Year\": \"1975-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"chevrolet monza 2+2\", \"Miles_per_Gallon\": 20.0, \"Cylinders\": 8, \"Displacement\": 262.0, \"Horsepower\": 110.0, \"Weight_in_lbs\": 3221, \"Acceleration\": 13.5, \"Year\": \"1975-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"ford mustang ii\", \"Miles_per_Gallon\": 13.0, \"Cylinders\": 8, \"Displacement\": 302.0, \"Horsepower\": 129.0, \"Weight_in_lbs\": 3169, \"Acceleration\": 12.0, \"Year\": \"1975-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"toyota corolla\", \"Miles_per_Gallon\": 29.0, \"Cylinders\": 4, \"Displacement\": 97.0, \"Horsepower\": 75.0, \"Weight_in_lbs\": 2171, \"Acceleration\": 16.0, \"Year\": \"1975-01-01T00:00:00\", \"Origin\": \"Japan\"}, {\"Name\": \"ford pinto\", \"Miles_per_Gallon\": 23.0, \"Cylinders\": 4, \"Displacement\": 140.0, \"Horsepower\": 83.0, \"Weight_in_lbs\": 2639, \"Acceleration\": 17.0, \"Year\": \"1975-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"amc gremlin\", \"Miles_per_Gallon\": 20.0, \"Cylinders\": 6, \"Displacement\": 232.0, \"Horsepower\": 100.0, \"Weight_in_lbs\": 2914, \"Acceleration\": 16.0, \"Year\": \"1975-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"pontiac astro\", \"Miles_per_Gallon\": 23.0, \"Cylinders\": 4, \"Displacement\": 140.0, \"Horsepower\": 78.0, \"Weight_in_lbs\": 2592, \"Acceleration\": 18.5, \"Year\": \"1975-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"toyota corona\", \"Miles_per_Gallon\": 24.0, \"Cylinders\": 4, \"Displacement\": 134.0, \"Horsepower\": 96.0, \"Weight_in_lbs\": 2702, \"Acceleration\": 13.5, \"Year\": \"1975-01-01T00:00:00\", \"Origin\": \"Japan\"}, {\"Name\": \"volkswagen dasher\", \"Miles_per_Gallon\": 25.0, \"Cylinders\": 4, \"Displacement\": 90.0, \"Horsepower\": 71.0, \"Weight_in_lbs\": 2223, \"Acceleration\": 16.5, \"Year\": \"1975-01-01T00:00:00\", \"Origin\": \"Europe\"}, {\"Name\": \"datsun 710\", \"Miles_per_Gallon\": 24.0, \"Cylinders\": 4, \"Displacement\": 119.0, \"Horsepower\": 97.0, \"Weight_in_lbs\": 2545, \"Acceleration\": 17.0, \"Year\": \"1975-01-01T00:00:00\", \"Origin\": \"Japan\"}, {\"Name\": \"ford pinto\", \"Miles_per_Gallon\": 18.0, \"Cylinders\": 6, \"Displacement\": 171.0, \"Horsepower\": 97.0, \"Weight_in_lbs\": 2984, \"Acceleration\": 14.5, \"Year\": \"1975-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"volkswagen rabbit\", \"Miles_per_Gallon\": 29.0, \"Cylinders\": 4, \"Displacement\": 90.0, \"Horsepower\": 70.0, \"Weight_in_lbs\": 1937, \"Acceleration\": 14.0, \"Year\": \"1975-01-01T00:00:00\", \"Origin\": \"Europe\"}, {\"Name\": \"amc pacer\", \"Miles_per_Gallon\": 19.0, \"Cylinders\": 6, \"Displacement\": 232.0, \"Horsepower\": 90.0, \"Weight_in_lbs\": 3211, \"Acceleration\": 17.0, \"Year\": \"1975-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"audi 100ls\", \"Miles_per_Gallon\": 23.0, \"Cylinders\": 4, \"Displacement\": 115.0, \"Horsepower\": 95.0, \"Weight_in_lbs\": 2694, \"Acceleration\": 15.0, \"Year\": \"1975-01-01T00:00:00\", \"Origin\": \"Europe\"}, {\"Name\": \"peugeot 504\", \"Miles_per_Gallon\": 23.0, \"Cylinders\": 4, \"Displacement\": 120.0, \"Horsepower\": 88.0, \"Weight_in_lbs\": 2957, \"Acceleration\": 17.0, \"Year\": \"1975-01-01T00:00:00\", \"Origin\": \"Europe\"}, {\"Name\": \"volvo 244dl\", \"Miles_per_Gallon\": 22.0, \"Cylinders\": 4, \"Displacement\": 121.0, \"Horsepower\": 98.0, \"Weight_in_lbs\": 2945, \"Acceleration\": 14.5, \"Year\": \"1975-01-01T00:00:00\", \"Origin\": \"Europe\"}, {\"Name\": \"saab 99le\", \"Miles_per_Gallon\": 25.0, \"Cylinders\": 4, \"Displacement\": 121.0, \"Horsepower\": 115.0, \"Weight_in_lbs\": 2671, \"Acceleration\": 13.5, \"Year\": \"1975-01-01T00:00:00\", \"Origin\": \"Europe\"}, {\"Name\": \"honda civic cvcc\", \"Miles_per_Gallon\": 33.0, \"Cylinders\": 4, \"Displacement\": 91.0, \"Horsepower\": 53.0, \"Weight_in_lbs\": 1795, \"Acceleration\": 17.5, \"Year\": \"1975-01-01T00:00:00\", \"Origin\": \"Japan\"}, {\"Name\": \"fiat 131\", \"Miles_per_Gallon\": 28.0, \"Cylinders\": 4, \"Displacement\": 107.0, \"Horsepower\": 86.0, \"Weight_in_lbs\": 2464, \"Acceleration\": 15.5, \"Year\": \"1976-01-01T00:00:00\", \"Origin\": \"Europe\"}, {\"Name\": \"opel 1900\", \"Miles_per_Gallon\": 25.0, \"Cylinders\": 4, \"Displacement\": 116.0, \"Horsepower\": 81.0, \"Weight_in_lbs\": 2220, \"Acceleration\": 16.9, \"Year\": \"1976-01-01T00:00:00\", \"Origin\": \"Europe\"}, {\"Name\": \"capri ii\", \"Miles_per_Gallon\": 25.0, \"Cylinders\": 4, \"Displacement\": 140.0, \"Horsepower\": 92.0, \"Weight_in_lbs\": 2572, \"Acceleration\": 14.9, \"Year\": \"1976-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"dodge colt\", \"Miles_per_Gallon\": 26.0, \"Cylinders\": 4, \"Displacement\": 98.0, \"Horsepower\": 79.0, \"Weight_in_lbs\": 2255, \"Acceleration\": 17.7, \"Year\": \"1976-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"renault 12tl\", \"Miles_per_Gallon\": 27.0, \"Cylinders\": 4, \"Displacement\": 101.0, \"Horsepower\": 83.0, \"Weight_in_lbs\": 2202, \"Acceleration\": 15.3, \"Year\": \"1976-01-01T00:00:00\", \"Origin\": \"Europe\"}, {\"Name\": \"chevrolet chevelle malibu classic\", \"Miles_per_Gallon\": 17.5, \"Cylinders\": 8, \"Displacement\": 305.0, \"Horsepower\": 140.0, \"Weight_in_lbs\": 4215, \"Acceleration\": 13.0, \"Year\": \"1976-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"dodge coronet brougham\", \"Miles_per_Gallon\": 16.0, \"Cylinders\": 8, \"Displacement\": 318.0, \"Horsepower\": 150.0, \"Weight_in_lbs\": 4190, \"Acceleration\": 13.0, \"Year\": \"1976-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"amc matador\", \"Miles_per_Gallon\": 15.5, \"Cylinders\": 8, \"Displacement\": 304.0, \"Horsepower\": 120.0, \"Weight_in_lbs\": 3962, \"Acceleration\": 13.9, \"Year\": \"1976-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"ford gran torino\", \"Miles_per_Gallon\": 14.5, \"Cylinders\": 8, \"Displacement\": 351.0, \"Horsepower\": 152.0, \"Weight_in_lbs\": 4215, \"Acceleration\": 12.8, \"Year\": \"1976-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"plymouth valiant\", \"Miles_per_Gallon\": 22.0, \"Cylinders\": 6, \"Displacement\": 225.0, \"Horsepower\": 100.0, \"Weight_in_lbs\": 3233, \"Acceleration\": 15.4, \"Year\": \"1976-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"chevrolet nova\", \"Miles_per_Gallon\": 22.0, \"Cylinders\": 6, \"Displacement\": 250.0, \"Horsepower\": 105.0, \"Weight_in_lbs\": 3353, \"Acceleration\": 14.5, \"Year\": \"1976-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"ford maverick\", \"Miles_per_Gallon\": 24.0, \"Cylinders\": 6, \"Displacement\": 200.0, \"Horsepower\": 81.0, \"Weight_in_lbs\": 3012, \"Acceleration\": 17.6, \"Year\": \"1976-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"amc hornet\", \"Miles_per_Gallon\": 22.5, \"Cylinders\": 6, \"Displacement\": 232.0, \"Horsepower\": 90.0, \"Weight_in_lbs\": 3085, \"Acceleration\": 17.6, \"Year\": \"1976-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"chevrolet chevette\", \"Miles_per_Gallon\": 29.0, \"Cylinders\": 4, \"Displacement\": 85.0, \"Horsepower\": 52.0, \"Weight_in_lbs\": 2035, \"Acceleration\": 22.2, \"Year\": \"1976-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"chevrolet woody\", \"Miles_per_Gallon\": 24.5, \"Cylinders\": 4, \"Displacement\": 98.0, \"Horsepower\": 60.0, \"Weight_in_lbs\": 2164, \"Acceleration\": 22.1, \"Year\": \"1976-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"vw rabbit\", \"Miles_per_Gallon\": 29.0, \"Cylinders\": 4, \"Displacement\": 90.0, \"Horsepower\": 70.0, \"Weight_in_lbs\": 1937, \"Acceleration\": 14.2, \"Year\": \"1976-01-01T00:00:00\", \"Origin\": \"Europe\"}, {\"Name\": \"honda civic\", \"Miles_per_Gallon\": 33.0, \"Cylinders\": 4, \"Displacement\": 91.0, \"Horsepower\": 53.0, \"Weight_in_lbs\": 1795, \"Acceleration\": 17.4, \"Year\": \"1976-01-01T00:00:00\", \"Origin\": \"Japan\"}, {\"Name\": \"dodge aspen se\", \"Miles_per_Gallon\": 20.0, \"Cylinders\": 6, \"Displacement\": 225.0, \"Horsepower\": 100.0, \"Weight_in_lbs\": 3651, \"Acceleration\": 17.7, \"Year\": \"1976-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"ford granada ghia\", \"Miles_per_Gallon\": 18.0, \"Cylinders\": 6, \"Displacement\": 250.0, \"Horsepower\": 78.0, \"Weight_in_lbs\": 3574, \"Acceleration\": 21.0, \"Year\": \"1976-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"pontiac ventura sj\", \"Miles_per_Gallon\": 18.5, \"Cylinders\": 6, \"Displacement\": 250.0, \"Horsepower\": 110.0, \"Weight_in_lbs\": 3645, \"Acceleration\": 16.2, \"Year\": \"1976-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"amc pacer d/l\", \"Miles_per_Gallon\": 17.5, \"Cylinders\": 6, \"Displacement\": 258.0, \"Horsepower\": 95.0, \"Weight_in_lbs\": 3193, \"Acceleration\": 17.8, \"Year\": \"1976-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"volkswagen rabbit\", \"Miles_per_Gallon\": 29.5, \"Cylinders\": 4, \"Displacement\": 97.0, \"Horsepower\": 71.0, \"Weight_in_lbs\": 1825, \"Acceleration\": 12.2, \"Year\": \"1976-01-01T00:00:00\", \"Origin\": \"Europe\"}, {\"Name\": \"datsun b-210\", \"Miles_per_Gallon\": 32.0, \"Cylinders\": 4, \"Displacement\": 85.0, \"Horsepower\": 70.0, \"Weight_in_lbs\": 1990, \"Acceleration\": 17.0, \"Year\": \"1976-01-01T00:00:00\", \"Origin\": \"Japan\"}, {\"Name\": \"toyota corolla\", \"Miles_per_Gallon\": 28.0, \"Cylinders\": 4, \"Displacement\": 97.0, \"Horsepower\": 75.0, \"Weight_in_lbs\": 2155, \"Acceleration\": 16.4, \"Year\": \"1976-01-01T00:00:00\", \"Origin\": \"Japan\"}, {\"Name\": \"ford pinto\", \"Miles_per_Gallon\": 26.5, \"Cylinders\": 4, \"Displacement\": 140.0, \"Horsepower\": 72.0, \"Weight_in_lbs\": 2565, \"Acceleration\": 13.6, \"Year\": \"1976-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"volvo 245\", \"Miles_per_Gallon\": 20.0, \"Cylinders\": 4, \"Displacement\": 130.0, \"Horsepower\": 102.0, \"Weight_in_lbs\": 3150, \"Acceleration\": 15.7, \"Year\": \"1976-01-01T00:00:00\", \"Origin\": \"Europe\"}, {\"Name\": \"plymouth volare premier v8\", \"Miles_per_Gallon\": 13.0, \"Cylinders\": 8, \"Displacement\": 318.0, \"Horsepower\": 150.0, \"Weight_in_lbs\": 3940, \"Acceleration\": 13.2, \"Year\": \"1976-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"peugeot 504\", \"Miles_per_Gallon\": 19.0, \"Cylinders\": 4, \"Displacement\": 120.0, \"Horsepower\": 88.0, \"Weight_in_lbs\": 3270, \"Acceleration\": 21.9, \"Year\": \"1976-01-01T00:00:00\", \"Origin\": \"Europe\"}, {\"Name\": \"toyota mark ii\", \"Miles_per_Gallon\": 19.0, \"Cylinders\": 6, \"Displacement\": 156.0, \"Horsepower\": 108.0, \"Weight_in_lbs\": 2930, \"Acceleration\": 15.5, \"Year\": \"1976-01-01T00:00:00\", \"Origin\": \"Japan\"}, {\"Name\": \"mercedes-benz 280s\", \"Miles_per_Gallon\": 16.5, \"Cylinders\": 6, \"Displacement\": 168.0, \"Horsepower\": 120.0, \"Weight_in_lbs\": 3820, \"Acceleration\": 16.7, \"Year\": \"1976-01-01T00:00:00\", \"Origin\": \"Europe\"}, {\"Name\": \"cadillac seville\", \"Miles_per_Gallon\": 16.5, \"Cylinders\": 8, \"Displacement\": 350.0, \"Horsepower\": 180.0, \"Weight_in_lbs\": 4380, \"Acceleration\": 12.1, \"Year\": \"1976-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"chevy c10\", \"Miles_per_Gallon\": 13.0, \"Cylinders\": 8, \"Displacement\": 350.0, \"Horsepower\": 145.0, \"Weight_in_lbs\": 4055, \"Acceleration\": 12.0, \"Year\": \"1976-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"ford f108\", \"Miles_per_Gallon\": 13.0, \"Cylinders\": 8, \"Displacement\": 302.0, \"Horsepower\": 130.0, \"Weight_in_lbs\": 3870, \"Acceleration\": 15.0, \"Year\": \"1976-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"dodge d100\", \"Miles_per_Gallon\": 13.0, \"Cylinders\": 8, \"Displacement\": 318.0, \"Horsepower\": 150.0, \"Weight_in_lbs\": 3755, \"Acceleration\": 14.0, \"Year\": \"1976-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"honda Accelerationord cvcc\", \"Miles_per_Gallon\": 31.5, \"Cylinders\": 4, \"Displacement\": 98.0, \"Horsepower\": 68.0, \"Weight_in_lbs\": 2045, \"Acceleration\": 18.5, \"Year\": \"1977-01-01T00:00:00\", \"Origin\": \"Japan\"}, {\"Name\": \"buick opel isuzu deluxe\", \"Miles_per_Gallon\": 30.0, \"Cylinders\": 4, \"Displacement\": 111.0, \"Horsepower\": 80.0, \"Weight_in_lbs\": 2155, \"Acceleration\": 14.8, \"Year\": \"1977-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"renault 5 gtl\", \"Miles_per_Gallon\": 36.0, \"Cylinders\": 4, \"Displacement\": 79.0, \"Horsepower\": 58.0, \"Weight_in_lbs\": 1825, \"Acceleration\": 18.6, \"Year\": \"1977-01-01T00:00:00\", \"Origin\": \"Europe\"}, {\"Name\": \"plymouth arrow gs\", \"Miles_per_Gallon\": 25.5, \"Cylinders\": 4, \"Displacement\": 122.0, \"Horsepower\": 96.0, \"Weight_in_lbs\": 2300, \"Acceleration\": 15.5, \"Year\": \"1977-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"datsun f-10 hatchback\", \"Miles_per_Gallon\": 33.5, \"Cylinders\": 4, \"Displacement\": 85.0, \"Horsepower\": 70.0, \"Weight_in_lbs\": 1945, \"Acceleration\": 16.8, \"Year\": \"1977-01-01T00:00:00\", \"Origin\": \"Japan\"}, {\"Name\": \"chevrolet caprice classic\", \"Miles_per_Gallon\": 17.5, \"Cylinders\": 8, \"Displacement\": 305.0, \"Horsepower\": 145.0, \"Weight_in_lbs\": 3880, \"Acceleration\": 12.5, \"Year\": \"1977-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"oldsmobile cutlass supreme\", \"Miles_per_Gallon\": 17.0, \"Cylinders\": 8, \"Displacement\": 260.0, \"Horsepower\": 110.0, \"Weight_in_lbs\": 4060, \"Acceleration\": 19.0, \"Year\": \"1977-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"dodge monaco brougham\", \"Miles_per_Gallon\": 15.5, \"Cylinders\": 8, \"Displacement\": 318.0, \"Horsepower\": 145.0, \"Weight_in_lbs\": 4140, \"Acceleration\": 13.7, \"Year\": \"1977-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"mercury cougar brougham\", \"Miles_per_Gallon\": 15.0, \"Cylinders\": 8, \"Displacement\": 302.0, \"Horsepower\": 130.0, \"Weight_in_lbs\": 4295, \"Acceleration\": 14.9, \"Year\": \"1977-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"chevrolet concours\", \"Miles_per_Gallon\": 17.5, \"Cylinders\": 6, \"Displacement\": 250.0, \"Horsepower\": 110.0, \"Weight_in_lbs\": 3520, \"Acceleration\": 16.4, \"Year\": \"1977-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"buick skylark\", \"Miles_per_Gallon\": 20.5, \"Cylinders\": 6, \"Displacement\": 231.0, \"Horsepower\": 105.0, \"Weight_in_lbs\": 3425, \"Acceleration\": 16.9, \"Year\": \"1977-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"plymouth volare custom\", \"Miles_per_Gallon\": 19.0, \"Cylinders\": 6, \"Displacement\": 225.0, \"Horsepower\": 100.0, \"Weight_in_lbs\": 3630, \"Acceleration\": 17.7, \"Year\": \"1977-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"ford granada\", \"Miles_per_Gallon\": 18.5, \"Cylinders\": 6, \"Displacement\": 250.0, \"Horsepower\": 98.0, \"Weight_in_lbs\": 3525, \"Acceleration\": 19.0, \"Year\": \"1977-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"pontiac grand prix lj\", \"Miles_per_Gallon\": 16.0, \"Cylinders\": 8, \"Displacement\": 400.0, \"Horsepower\": 180.0, \"Weight_in_lbs\": 4220, \"Acceleration\": 11.1, \"Year\": \"1977-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"chevrolet monte carlo landau\", \"Miles_per_Gallon\": 15.5, \"Cylinders\": 8, \"Displacement\": 350.0, \"Horsepower\": 170.0, \"Weight_in_lbs\": 4165, \"Acceleration\": 11.4, \"Year\": \"1977-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"chrysler cordoba\", \"Miles_per_Gallon\": 15.5, \"Cylinders\": 8, \"Displacement\": 400.0, \"Horsepower\": 190.0, \"Weight_in_lbs\": 4325, \"Acceleration\": 12.2, \"Year\": \"1977-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"ford thunderbird\", \"Miles_per_Gallon\": 16.0, \"Cylinders\": 8, \"Displacement\": 351.0, \"Horsepower\": 149.0, \"Weight_in_lbs\": 4335, \"Acceleration\": 14.5, \"Year\": \"1977-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"volkswagen rabbit custom\", \"Miles_per_Gallon\": 29.0, \"Cylinders\": 4, \"Displacement\": 97.0, \"Horsepower\": 78.0, \"Weight_in_lbs\": 1940, \"Acceleration\": 14.5, \"Year\": \"1977-01-01T00:00:00\", \"Origin\": \"Europe\"}, {\"Name\": \"pontiac sunbird coupe\", \"Miles_per_Gallon\": 24.5, \"Cylinders\": 4, \"Displacement\": 151.0, \"Horsepower\": 88.0, \"Weight_in_lbs\": 2740, \"Acceleration\": 16.0, \"Year\": \"1977-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"toyota corolla liftback\", \"Miles_per_Gallon\": 26.0, \"Cylinders\": 4, \"Displacement\": 97.0, \"Horsepower\": 75.0, \"Weight_in_lbs\": 2265, \"Acceleration\": 18.2, \"Year\": \"1977-01-01T00:00:00\", \"Origin\": \"Japan\"}, {\"Name\": \"ford mustang ii 2+2\", \"Miles_per_Gallon\": 25.5, \"Cylinders\": 4, \"Displacement\": 140.0, \"Horsepower\": 89.0, \"Weight_in_lbs\": 2755, \"Acceleration\": 15.8, \"Year\": \"1977-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"chevrolet chevette\", \"Miles_per_Gallon\": 30.5, \"Cylinders\": 4, \"Displacement\": 98.0, \"Horsepower\": 63.0, \"Weight_in_lbs\": 2051, \"Acceleration\": 17.0, \"Year\": \"1977-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"dodge colt m/m\", \"Miles_per_Gallon\": 33.5, \"Cylinders\": 4, \"Displacement\": 98.0, \"Horsepower\": 83.0, \"Weight_in_lbs\": 2075, \"Acceleration\": 15.9, \"Year\": \"1977-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"subaru dl\", \"Miles_per_Gallon\": 30.0, \"Cylinders\": 4, \"Displacement\": 97.0, \"Horsepower\": 67.0, \"Weight_in_lbs\": 1985, \"Acceleration\": 16.4, \"Year\": \"1977-01-01T00:00:00\", \"Origin\": \"Japan\"}, {\"Name\": \"volkswagen dasher\", \"Miles_per_Gallon\": 30.5, \"Cylinders\": 4, \"Displacement\": 97.0, \"Horsepower\": 78.0, \"Weight_in_lbs\": 2190, \"Acceleration\": 14.1, \"Year\": \"1977-01-01T00:00:00\", \"Origin\": \"Europe\"}, {\"Name\": \"datsun 810\", \"Miles_per_Gallon\": 22.0, \"Cylinders\": 6, \"Displacement\": 146.0, \"Horsepower\": 97.0, \"Weight_in_lbs\": 2815, \"Acceleration\": 14.5, \"Year\": \"1977-01-01T00:00:00\", \"Origin\": \"Japan\"}, {\"Name\": \"bmw 320i\", \"Miles_per_Gallon\": 21.5, \"Cylinders\": 4, \"Displacement\": 121.0, \"Horsepower\": 110.0, \"Weight_in_lbs\": 2600, \"Acceleration\": 12.8, \"Year\": \"1977-01-01T00:00:00\", \"Origin\": \"Europe\"}, {\"Name\": \"mazda rx-4\", \"Miles_per_Gallon\": 21.5, \"Cylinders\": 3, \"Displacement\": 80.0, \"Horsepower\": 110.0, \"Weight_in_lbs\": 2720, \"Acceleration\": 13.5, \"Year\": \"1977-01-01T00:00:00\", \"Origin\": \"Japan\"}, {\"Name\": \"volkswagen rabbit custom diesel\", \"Miles_per_Gallon\": 43.1, \"Cylinders\": 4, \"Displacement\": 90.0, \"Horsepower\": 48.0, \"Weight_in_lbs\": 1985, \"Acceleration\": 21.5, \"Year\": \"1978-01-01T00:00:00\", \"Origin\": \"Europe\"}, {\"Name\": \"ford fiesta\", \"Miles_per_Gallon\": 36.1, \"Cylinders\": 4, \"Displacement\": 98.0, \"Horsepower\": 66.0, \"Weight_in_lbs\": 1800, \"Acceleration\": 14.4, \"Year\": \"1978-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"mazda glc deluxe\", \"Miles_per_Gallon\": 32.8, \"Cylinders\": 4, \"Displacement\": 78.0, \"Horsepower\": 52.0, \"Weight_in_lbs\": 1985, \"Acceleration\": 19.4, \"Year\": \"1978-01-01T00:00:00\", \"Origin\": \"Japan\"}, {\"Name\": \"datsun b210 gx\", \"Miles_per_Gallon\": 39.4, \"Cylinders\": 4, \"Displacement\": 85.0, \"Horsepower\": 70.0, \"Weight_in_lbs\": 2070, \"Acceleration\": 18.6, \"Year\": \"1978-01-01T00:00:00\", \"Origin\": \"Japan\"}, {\"Name\": \"honda civic cvcc\", \"Miles_per_Gallon\": 36.1, \"Cylinders\": 4, \"Displacement\": 91.0, \"Horsepower\": 60.0, \"Weight_in_lbs\": 1800, \"Acceleration\": 16.4, \"Year\": \"1978-01-01T00:00:00\", \"Origin\": \"Japan\"}, {\"Name\": \"oldsmobile cutlass salon brougham\", \"Miles_per_Gallon\": 19.9, \"Cylinders\": 8, \"Displacement\": 260.0, \"Horsepower\": 110.0, \"Weight_in_lbs\": 3365, \"Acceleration\": 15.5, \"Year\": \"1978-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"dodge diplomat\", \"Miles_per_Gallon\": 19.4, \"Cylinders\": 8, \"Displacement\": 318.0, \"Horsepower\": 140.0, \"Weight_in_lbs\": 3735, \"Acceleration\": 13.2, \"Year\": \"1978-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"mercury monarch ghia\", \"Miles_per_Gallon\": 20.2, \"Cylinders\": 8, \"Displacement\": 302.0, \"Horsepower\": 139.0, \"Weight_in_lbs\": 3570, \"Acceleration\": 12.8, \"Year\": \"1978-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"pontiac phoenix lj\", \"Miles_per_Gallon\": 19.2, \"Cylinders\": 6, \"Displacement\": 231.0, \"Horsepower\": 105.0, \"Weight_in_lbs\": 3535, \"Acceleration\": 19.2, \"Year\": \"1978-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"chevrolet malibu\", \"Miles_per_Gallon\": 20.5, \"Cylinders\": 6, \"Displacement\": 200.0, \"Horsepower\": 95.0, \"Weight_in_lbs\": 3155, \"Acceleration\": 18.2, \"Year\": \"1978-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"ford fairmont (auto)\", \"Miles_per_Gallon\": 20.2, \"Cylinders\": 6, \"Displacement\": 200.0, \"Horsepower\": 85.0, \"Weight_in_lbs\": 2965, \"Acceleration\": 15.8, \"Year\": \"1978-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"ford fairmont (man)\", \"Miles_per_Gallon\": 25.1, \"Cylinders\": 4, \"Displacement\": 140.0, \"Horsepower\": 88.0, \"Weight_in_lbs\": 2720, \"Acceleration\": 15.4, \"Year\": \"1978-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"plymouth volare\", \"Miles_per_Gallon\": 20.5, \"Cylinders\": 6, \"Displacement\": 225.0, \"Horsepower\": 100.0, \"Weight_in_lbs\": 3430, \"Acceleration\": 17.2, \"Year\": \"1978-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"amc concord\", \"Miles_per_Gallon\": 19.4, \"Cylinders\": 6, \"Displacement\": 232.0, \"Horsepower\": 90.0, \"Weight_in_lbs\": 3210, \"Acceleration\": 17.2, \"Year\": \"1978-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"buick century special\", \"Miles_per_Gallon\": 20.6, \"Cylinders\": 6, \"Displacement\": 231.0, \"Horsepower\": 105.0, \"Weight_in_lbs\": 3380, \"Acceleration\": 15.8, \"Year\": \"1978-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"mercury zephyr\", \"Miles_per_Gallon\": 20.8, \"Cylinders\": 6, \"Displacement\": 200.0, \"Horsepower\": 85.0, \"Weight_in_lbs\": 3070, \"Acceleration\": 16.7, \"Year\": \"1978-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"dodge aspen\", \"Miles_per_Gallon\": 18.6, \"Cylinders\": 6, \"Displacement\": 225.0, \"Horsepower\": 110.0, \"Weight_in_lbs\": 3620, \"Acceleration\": 18.7, \"Year\": \"1978-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"amc concord d/l\", \"Miles_per_Gallon\": 18.1, \"Cylinders\": 6, \"Displacement\": 258.0, \"Horsepower\": 120.0, \"Weight_in_lbs\": 3410, \"Acceleration\": 15.1, \"Year\": \"1978-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"chevrolet monte carlo landau\", \"Miles_per_Gallon\": 19.2, \"Cylinders\": 8, \"Displacement\": 305.0, \"Horsepower\": 145.0, \"Weight_in_lbs\": 3425, \"Acceleration\": 13.2, \"Year\": \"1978-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"buick regal sport coupe (turbo)\", \"Miles_per_Gallon\": 17.7, \"Cylinders\": 6, \"Displacement\": 231.0, \"Horsepower\": 165.0, \"Weight_in_lbs\": 3445, \"Acceleration\": 13.4, \"Year\": \"1978-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"ford futura\", \"Miles_per_Gallon\": 18.1, \"Cylinders\": 8, \"Displacement\": 302.0, \"Horsepower\": 139.0, \"Weight_in_lbs\": 3205, \"Acceleration\": 11.2, \"Year\": \"1978-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"dodge magnum xe\", \"Miles_per_Gallon\": 17.5, \"Cylinders\": 8, \"Displacement\": 318.0, \"Horsepower\": 140.0, \"Weight_in_lbs\": 4080, \"Acceleration\": 13.7, \"Year\": \"1978-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"chevrolet chevette\", \"Miles_per_Gallon\": 30.0, \"Cylinders\": 4, \"Displacement\": 98.0, \"Horsepower\": 68.0, \"Weight_in_lbs\": 2155, \"Acceleration\": 16.5, \"Year\": \"1978-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"toyota corona\", \"Miles_per_Gallon\": 27.5, \"Cylinders\": 4, \"Displacement\": 134.0, \"Horsepower\": 95.0, \"Weight_in_lbs\": 2560, \"Acceleration\": 14.2, \"Year\": \"1978-01-01T00:00:00\", \"Origin\": \"Japan\"}, {\"Name\": \"datsun 510\", \"Miles_per_Gallon\": 27.2, \"Cylinders\": 4, \"Displacement\": 119.0, \"Horsepower\": 97.0, \"Weight_in_lbs\": 2300, \"Acceleration\": 14.7, \"Year\": \"1978-01-01T00:00:00\", \"Origin\": \"Japan\"}, {\"Name\": \"dodge omni\", \"Miles_per_Gallon\": 30.9, \"Cylinders\": 4, \"Displacement\": 105.0, \"Horsepower\": 75.0, \"Weight_in_lbs\": 2230, \"Acceleration\": 14.5, \"Year\": \"1978-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"toyota celica gt liftback\", \"Miles_per_Gallon\": 21.1, \"Cylinders\": 4, \"Displacement\": 134.0, \"Horsepower\": 95.0, \"Weight_in_lbs\": 2515, \"Acceleration\": 14.8, \"Year\": \"1978-01-01T00:00:00\", \"Origin\": \"Japan\"}, {\"Name\": \"plymouth sapporo\", \"Miles_per_Gallon\": 23.2, \"Cylinders\": 4, \"Displacement\": 156.0, \"Horsepower\": 105.0, \"Weight_in_lbs\": 2745, \"Acceleration\": 16.7, \"Year\": \"1978-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"oldsmobile starfire sx\", \"Miles_per_Gallon\": 23.8, \"Cylinders\": 4, \"Displacement\": 151.0, \"Horsepower\": 85.0, \"Weight_in_lbs\": 2855, \"Acceleration\": 17.6, \"Year\": \"1978-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"datsun 200-sx\", \"Miles_per_Gallon\": 23.9, \"Cylinders\": 4, \"Displacement\": 119.0, \"Horsepower\": 97.0, \"Weight_in_lbs\": 2405, \"Acceleration\": 14.9, \"Year\": \"1978-01-01T00:00:00\", \"Origin\": \"Japan\"}, {\"Name\": \"audi 5000\", \"Miles_per_Gallon\": 20.3, \"Cylinders\": 5, \"Displacement\": 131.0, \"Horsepower\": 103.0, \"Weight_in_lbs\": 2830, \"Acceleration\": 15.9, \"Year\": \"1978-01-01T00:00:00\", \"Origin\": \"Europe\"}, {\"Name\": \"volvo 264gl\", \"Miles_per_Gallon\": 17.0, \"Cylinders\": 6, \"Displacement\": 163.0, \"Horsepower\": 125.0, \"Weight_in_lbs\": 3140, \"Acceleration\": 13.6, \"Year\": \"1978-01-01T00:00:00\", \"Origin\": \"Europe\"}, {\"Name\": \"saab 99gle\", \"Miles_per_Gallon\": 21.6, \"Cylinders\": 4, \"Displacement\": 121.0, \"Horsepower\": 115.0, \"Weight_in_lbs\": 2795, \"Acceleration\": 15.7, \"Year\": \"1978-01-01T00:00:00\", \"Origin\": \"Europe\"}, {\"Name\": \"peugeot 604sl\", \"Miles_per_Gallon\": 16.2, \"Cylinders\": 6, \"Displacement\": 163.0, \"Horsepower\": 133.0, \"Weight_in_lbs\": 3410, \"Acceleration\": 15.8, \"Year\": \"1978-01-01T00:00:00\", \"Origin\": \"Europe\"}, {\"Name\": \"volkswagen scirocco\", \"Miles_per_Gallon\": 31.5, \"Cylinders\": 4, \"Displacement\": 89.0, \"Horsepower\": 71.0, \"Weight_in_lbs\": 1990, \"Acceleration\": 14.9, \"Year\": \"1978-01-01T00:00:00\", \"Origin\": \"Europe\"}, {\"Name\": \"honda Accelerationord lx\", \"Miles_per_Gallon\": 29.5, \"Cylinders\": 4, \"Displacement\": 98.0, \"Horsepower\": 68.0, \"Weight_in_lbs\": 2135, \"Acceleration\": 16.6, \"Year\": \"1978-01-01T00:00:00\", \"Origin\": \"Japan\"}, {\"Name\": \"pontiac lemans v6\", \"Miles_per_Gallon\": 21.5, \"Cylinders\": 6, \"Displacement\": 231.0, \"Horsepower\": 115.0, \"Weight_in_lbs\": 3245, \"Acceleration\": 15.4, \"Year\": \"1979-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"mercury zephyr 6\", \"Miles_per_Gallon\": 19.8, \"Cylinders\": 6, \"Displacement\": 200.0, \"Horsepower\": 85.0, \"Weight_in_lbs\": 2990, \"Acceleration\": 18.2, \"Year\": \"1979-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"ford fairmont 4\", \"Miles_per_Gallon\": 22.3, \"Cylinders\": 4, \"Displacement\": 140.0, \"Horsepower\": 88.0, \"Weight_in_lbs\": 2890, \"Acceleration\": 17.3, \"Year\": \"1979-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"amc concord dl 6\", \"Miles_per_Gallon\": 20.2, \"Cylinders\": 6, \"Displacement\": 232.0, \"Horsepower\": 90.0, \"Weight_in_lbs\": 3265, \"Acceleration\": 18.2, \"Year\": \"1979-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"dodge aspen 6\", \"Miles_per_Gallon\": 20.6, \"Cylinders\": 6, \"Displacement\": 225.0, \"Horsepower\": 110.0, \"Weight_in_lbs\": 3360, \"Acceleration\": 16.6, \"Year\": \"1979-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"chevrolet caprice classic\", \"Miles_per_Gallon\": 17.0, \"Cylinders\": 8, \"Displacement\": 305.0, \"Horsepower\": 130.0, \"Weight_in_lbs\": 3840, \"Acceleration\": 15.4, \"Year\": \"1979-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"ford ltd landau\", \"Miles_per_Gallon\": 17.6, \"Cylinders\": 8, \"Displacement\": 302.0, \"Horsepower\": 129.0, \"Weight_in_lbs\": 3725, \"Acceleration\": 13.4, \"Year\": \"1979-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"mercury grand marquis\", \"Miles_per_Gallon\": 16.5, \"Cylinders\": 8, \"Displacement\": 351.0, \"Horsepower\": 138.0, \"Weight_in_lbs\": 3955, \"Acceleration\": 13.2, \"Year\": \"1979-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"dodge st. regis\", \"Miles_per_Gallon\": 18.2, \"Cylinders\": 8, \"Displacement\": 318.0, \"Horsepower\": 135.0, \"Weight_in_lbs\": 3830, \"Acceleration\": 15.2, \"Year\": \"1979-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"buick estate wagon (sw)\", \"Miles_per_Gallon\": 16.9, \"Cylinders\": 8, \"Displacement\": 350.0, \"Horsepower\": 155.0, \"Weight_in_lbs\": 4360, \"Acceleration\": 14.9, \"Year\": \"1979-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"ford country squire (sw)\", \"Miles_per_Gallon\": 15.5, \"Cylinders\": 8, \"Displacement\": 351.0, \"Horsepower\": 142.0, \"Weight_in_lbs\": 4054, \"Acceleration\": 14.3, \"Year\": \"1979-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"chevrolet malibu classic (sw)\", \"Miles_per_Gallon\": 19.2, \"Cylinders\": 8, \"Displacement\": 267.0, \"Horsepower\": 125.0, \"Weight_in_lbs\": 3605, \"Acceleration\": 15.0, \"Year\": \"1979-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"chrysler lebaron town @ country (sw)\", \"Miles_per_Gallon\": 18.5, \"Cylinders\": 8, \"Displacement\": 360.0, \"Horsepower\": 150.0, \"Weight_in_lbs\": 3940, \"Acceleration\": 13.0, \"Year\": \"1979-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"vw rabbit custom\", \"Miles_per_Gallon\": 31.9, \"Cylinders\": 4, \"Displacement\": 89.0, \"Horsepower\": 71.0, \"Weight_in_lbs\": 1925, \"Acceleration\": 14.0, \"Year\": \"1979-01-01T00:00:00\", \"Origin\": \"Europe\"}, {\"Name\": \"maxda glc deluxe\", \"Miles_per_Gallon\": 34.1, \"Cylinders\": 4, \"Displacement\": 86.0, \"Horsepower\": 65.0, \"Weight_in_lbs\": 1975, \"Acceleration\": 15.2, \"Year\": \"1979-01-01T00:00:00\", \"Origin\": \"Japan\"}, {\"Name\": \"dodge colt hatchback custom\", \"Miles_per_Gallon\": 35.7, \"Cylinders\": 4, \"Displacement\": 98.0, \"Horsepower\": 80.0, \"Weight_in_lbs\": 1915, \"Acceleration\": 14.4, \"Year\": \"1979-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"amc spirit dl\", \"Miles_per_Gallon\": 27.4, \"Cylinders\": 4, \"Displacement\": 121.0, \"Horsepower\": 80.0, \"Weight_in_lbs\": 2670, \"Acceleration\": 15.0, \"Year\": \"1979-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"mercedes benz 300d\", \"Miles_per_Gallon\": 25.4, \"Cylinders\": 5, \"Displacement\": 183.0, \"Horsepower\": 77.0, \"Weight_in_lbs\": 3530, \"Acceleration\": 20.1, \"Year\": \"1979-01-01T00:00:00\", \"Origin\": \"Europe\"}, {\"Name\": \"cadillac eldorado\", \"Miles_per_Gallon\": 23.0, \"Cylinders\": 8, \"Displacement\": 350.0, \"Horsepower\": 125.0, \"Weight_in_lbs\": 3900, \"Acceleration\": 17.4, \"Year\": \"1979-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"peugeot 504\", \"Miles_per_Gallon\": 27.2, \"Cylinders\": 4, \"Displacement\": 141.0, \"Horsepower\": 71.0, \"Weight_in_lbs\": 3190, \"Acceleration\": 24.8, \"Year\": \"1979-01-01T00:00:00\", \"Origin\": \"Europe\"}, {\"Name\": \"oldsmobile cutlass salon brougham\", \"Miles_per_Gallon\": 23.9, \"Cylinders\": 8, \"Displacement\": 260.0, \"Horsepower\": 90.0, \"Weight_in_lbs\": 3420, \"Acceleration\": 22.2, \"Year\": \"1979-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"plymouth horizon\", \"Miles_per_Gallon\": 34.2, \"Cylinders\": 4, \"Displacement\": 105.0, \"Horsepower\": 70.0, \"Weight_in_lbs\": 2200, \"Acceleration\": 13.2, \"Year\": \"1979-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"plymouth horizon tc3\", \"Miles_per_Gallon\": 34.5, \"Cylinders\": 4, \"Displacement\": 105.0, \"Horsepower\": 70.0, \"Weight_in_lbs\": 2150, \"Acceleration\": 14.9, \"Year\": \"1979-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"datsun 210\", \"Miles_per_Gallon\": 31.8, \"Cylinders\": 4, \"Displacement\": 85.0, \"Horsepower\": 65.0, \"Weight_in_lbs\": 2020, \"Acceleration\": 19.2, \"Year\": \"1979-01-01T00:00:00\", \"Origin\": \"Japan\"}, {\"Name\": \"fiat strada custom\", \"Miles_per_Gallon\": 37.3, \"Cylinders\": 4, \"Displacement\": 91.0, \"Horsepower\": 69.0, \"Weight_in_lbs\": 2130, \"Acceleration\": 14.7, \"Year\": \"1979-01-01T00:00:00\", \"Origin\": \"Europe\"}, {\"Name\": \"buick skylark limited\", \"Miles_per_Gallon\": 28.4, \"Cylinders\": 4, \"Displacement\": 151.0, \"Horsepower\": 90.0, \"Weight_in_lbs\": 2670, \"Acceleration\": 16.0, \"Year\": \"1979-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"chevrolet citation\", \"Miles_per_Gallon\": 28.8, \"Cylinders\": 6, \"Displacement\": 173.0, \"Horsepower\": 115.0, \"Weight_in_lbs\": 2595, \"Acceleration\": 11.3, \"Year\": \"1979-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"oldsmobile omega brougham\", \"Miles_per_Gallon\": 26.8, \"Cylinders\": 6, \"Displacement\": 173.0, \"Horsepower\": 115.0, \"Weight_in_lbs\": 2700, \"Acceleration\": 12.9, \"Year\": \"1979-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"pontiac phoenix\", \"Miles_per_Gallon\": 33.5, \"Cylinders\": 4, \"Displacement\": 151.0, \"Horsepower\": 90.0, \"Weight_in_lbs\": 2556, \"Acceleration\": 13.2, \"Year\": \"1979-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"vw rabbit\", \"Miles_per_Gallon\": 41.5, \"Cylinders\": 4, \"Displacement\": 98.0, \"Horsepower\": 76.0, \"Weight_in_lbs\": 2144, \"Acceleration\": 14.7, \"Year\": \"1980-01-01T00:00:00\", \"Origin\": \"Europe\"}, {\"Name\": \"toyota corolla tercel\", \"Miles_per_Gallon\": 38.1, \"Cylinders\": 4, \"Displacement\": 89.0, \"Horsepower\": 60.0, \"Weight_in_lbs\": 1968, \"Acceleration\": 18.8, \"Year\": \"1980-01-01T00:00:00\", \"Origin\": \"Japan\"}, {\"Name\": \"chevrolet chevette\", \"Miles_per_Gallon\": 32.1, \"Cylinders\": 4, \"Displacement\": 98.0, \"Horsepower\": 70.0, \"Weight_in_lbs\": 2120, \"Acceleration\": 15.5, \"Year\": \"1980-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"datsun 310\", \"Miles_per_Gallon\": 37.2, \"Cylinders\": 4, \"Displacement\": 86.0, \"Horsepower\": 65.0, \"Weight_in_lbs\": 2019, \"Acceleration\": 16.4, \"Year\": \"1980-01-01T00:00:00\", \"Origin\": \"Japan\"}, {\"Name\": \"chevrolet citation\", \"Miles_per_Gallon\": 28.0, \"Cylinders\": 4, \"Displacement\": 151.0, \"Horsepower\": 90.0, \"Weight_in_lbs\": 2678, \"Acceleration\": 16.5, \"Year\": \"1980-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"ford fairmont\", \"Miles_per_Gallon\": 26.4, \"Cylinders\": 4, \"Displacement\": 140.0, \"Horsepower\": 88.0, \"Weight_in_lbs\": 2870, \"Acceleration\": 18.1, \"Year\": \"1980-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"amc concord\", \"Miles_per_Gallon\": 24.3, \"Cylinders\": 4, \"Displacement\": 151.0, \"Horsepower\": 90.0, \"Weight_in_lbs\": 3003, \"Acceleration\": 20.1, \"Year\": \"1980-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"dodge aspen\", \"Miles_per_Gallon\": 19.1, \"Cylinders\": 6, \"Displacement\": 225.0, \"Horsepower\": 90.0, \"Weight_in_lbs\": 3381, \"Acceleration\": 18.7, \"Year\": \"1980-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"audi 4000\", \"Miles_per_Gallon\": 34.3, \"Cylinders\": 4, \"Displacement\": 97.0, \"Horsepower\": 78.0, \"Weight_in_lbs\": 2188, \"Acceleration\": 15.8, \"Year\": \"1980-01-01T00:00:00\", \"Origin\": \"Europe\"}, {\"Name\": \"toyota corona liftback\", \"Miles_per_Gallon\": 29.8, \"Cylinders\": 4, \"Displacement\": 134.0, \"Horsepower\": 90.0, \"Weight_in_lbs\": 2711, \"Acceleration\": 15.5, \"Year\": \"1980-01-01T00:00:00\", \"Origin\": \"Japan\"}, {\"Name\": \"mazda 626\", \"Miles_per_Gallon\": 31.3, \"Cylinders\": 4, \"Displacement\": 120.0, \"Horsepower\": 75.0, \"Weight_in_lbs\": 2542, \"Acceleration\": 17.5, \"Year\": \"1980-01-01T00:00:00\", \"Origin\": \"Japan\"}, {\"Name\": \"datsun 510 hatchback\", \"Miles_per_Gallon\": 37.0, \"Cylinders\": 4, \"Displacement\": 119.0, \"Horsepower\": 92.0, \"Weight_in_lbs\": 2434, \"Acceleration\": 15.0, \"Year\": \"1980-01-01T00:00:00\", \"Origin\": \"Japan\"}, {\"Name\": \"toyota corolla\", \"Miles_per_Gallon\": 32.2, \"Cylinders\": 4, \"Displacement\": 108.0, \"Horsepower\": 75.0, \"Weight_in_lbs\": 2265, \"Acceleration\": 15.2, \"Year\": \"1980-01-01T00:00:00\", \"Origin\": \"Japan\"}, {\"Name\": \"mazda glc\", \"Miles_per_Gallon\": 46.6, \"Cylinders\": 4, \"Displacement\": 86.0, \"Horsepower\": 65.0, \"Weight_in_lbs\": 2110, \"Acceleration\": 17.9, \"Year\": \"1980-01-01T00:00:00\", \"Origin\": \"Japan\"}, {\"Name\": \"dodge colt\", \"Miles_per_Gallon\": 27.9, \"Cylinders\": 4, \"Displacement\": 156.0, \"Horsepower\": 105.0, \"Weight_in_lbs\": 2800, \"Acceleration\": 14.4, \"Year\": \"1980-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"datsun 210\", \"Miles_per_Gallon\": 40.8, \"Cylinders\": 4, \"Displacement\": 85.0, \"Horsepower\": 65.0, \"Weight_in_lbs\": 2110, \"Acceleration\": 19.2, \"Year\": \"1980-01-01T00:00:00\", \"Origin\": \"Japan\"}, {\"Name\": \"vw rabbit c (diesel)\", \"Miles_per_Gallon\": 44.3, \"Cylinders\": 4, \"Displacement\": 90.0, \"Horsepower\": 48.0, \"Weight_in_lbs\": 2085, \"Acceleration\": 21.7, \"Year\": \"1980-01-01T00:00:00\", \"Origin\": \"Europe\"}, {\"Name\": \"vw dasher (diesel)\", \"Miles_per_Gallon\": 43.4, \"Cylinders\": 4, \"Displacement\": 90.0, \"Horsepower\": 48.0, \"Weight_in_lbs\": 2335, \"Acceleration\": 23.7, \"Year\": \"1980-01-01T00:00:00\", \"Origin\": \"Europe\"}, {\"Name\": \"audi 5000s (diesel)\", \"Miles_per_Gallon\": 36.4, \"Cylinders\": 5, \"Displacement\": 121.0, \"Horsepower\": 67.0, \"Weight_in_lbs\": 2950, \"Acceleration\": 19.9, \"Year\": \"1980-01-01T00:00:00\", \"Origin\": \"Europe\"}, {\"Name\": \"mercedes-benz 240d\", \"Miles_per_Gallon\": 30.0, \"Cylinders\": 4, \"Displacement\": 146.0, \"Horsepower\": 67.0, \"Weight_in_lbs\": 3250, \"Acceleration\": 21.8, \"Year\": \"1980-01-01T00:00:00\", \"Origin\": \"Europe\"}, {\"Name\": \"honda civic 1500 gl\", \"Miles_per_Gallon\": 44.6, \"Cylinders\": 4, \"Displacement\": 91.0, \"Horsepower\": 67.0, \"Weight_in_lbs\": 1850, \"Acceleration\": 13.8, \"Year\": \"1980-01-01T00:00:00\", \"Origin\": \"Japan\"}, {\"Name\": \"renault lecar deluxe\", \"Miles_per_Gallon\": 40.9, \"Cylinders\": 4, \"Displacement\": 85.0, \"Horsepower\": null, \"Weight_in_lbs\": 1835, \"Acceleration\": 17.3, \"Year\": \"1980-01-01T00:00:00\", \"Origin\": \"Europe\"}, {\"Name\": \"subaru dl\", \"Miles_per_Gallon\": 33.8, \"Cylinders\": 4, \"Displacement\": 97.0, \"Horsepower\": 67.0, \"Weight_in_lbs\": 2145, \"Acceleration\": 18.0, \"Year\": \"1980-01-01T00:00:00\", \"Origin\": \"Japan\"}, {\"Name\": \"vokswagen rabbit\", \"Miles_per_Gallon\": 29.8, \"Cylinders\": 4, \"Displacement\": 89.0, \"Horsepower\": 62.0, \"Weight_in_lbs\": 1845, \"Acceleration\": 15.3, \"Year\": \"1980-01-01T00:00:00\", \"Origin\": \"Europe\"}, {\"Name\": \"datsun 280-zx\", \"Miles_per_Gallon\": 32.7, \"Cylinders\": 6, \"Displacement\": 168.0, \"Horsepower\": 132.0, \"Weight_in_lbs\": 2910, \"Acceleration\": 11.4, \"Year\": \"1980-01-01T00:00:00\", \"Origin\": \"Japan\"}, {\"Name\": \"mazda rx-7 gs\", \"Miles_per_Gallon\": 23.7, \"Cylinders\": 3, \"Displacement\": 70.0, \"Horsepower\": 100.0, \"Weight_in_lbs\": 2420, \"Acceleration\": 12.5, \"Year\": \"1980-01-01T00:00:00\", \"Origin\": \"Japan\"}, {\"Name\": \"triumph tr7 coupe\", \"Miles_per_Gallon\": 35.0, \"Cylinders\": 4, \"Displacement\": 122.0, \"Horsepower\": 88.0, \"Weight_in_lbs\": 2500, \"Acceleration\": 15.1, \"Year\": \"1980-01-01T00:00:00\", \"Origin\": \"Europe\"}, {\"Name\": \"ford mustang cobra\", \"Miles_per_Gallon\": 23.6, \"Cylinders\": 4, \"Displacement\": 140.0, \"Horsepower\": null, \"Weight_in_lbs\": 2905, \"Acceleration\": 14.3, \"Year\": \"1980-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"honda Accelerationord\", \"Miles_per_Gallon\": 32.4, \"Cylinders\": 4, \"Displacement\": 107.0, \"Horsepower\": 72.0, \"Weight_in_lbs\": 2290, \"Acceleration\": 17.0, \"Year\": \"1980-01-01T00:00:00\", \"Origin\": \"Japan\"}, {\"Name\": \"plymouth reliant\", \"Miles_per_Gallon\": 27.2, \"Cylinders\": 4, \"Displacement\": 135.0, \"Horsepower\": 84.0, \"Weight_in_lbs\": 2490, \"Acceleration\": 15.7, \"Year\": \"1982-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"buick skylark\", \"Miles_per_Gallon\": 26.6, \"Cylinders\": 4, \"Displacement\": 151.0, \"Horsepower\": 84.0, \"Weight_in_lbs\": 2635, \"Acceleration\": 16.4, \"Year\": \"1982-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"dodge aries wagon (sw)\", \"Miles_per_Gallon\": 25.8, \"Cylinders\": 4, \"Displacement\": 156.0, \"Horsepower\": 92.0, \"Weight_in_lbs\": 2620, \"Acceleration\": 14.4, \"Year\": \"1982-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"chevrolet citation\", \"Miles_per_Gallon\": 23.5, \"Cylinders\": 6, \"Displacement\": 173.0, \"Horsepower\": 110.0, \"Weight_in_lbs\": 2725, \"Acceleration\": 12.6, \"Year\": \"1982-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"plymouth reliant\", \"Miles_per_Gallon\": 30.0, \"Cylinders\": 4, \"Displacement\": 135.0, \"Horsepower\": 84.0, \"Weight_in_lbs\": 2385, \"Acceleration\": 12.9, \"Year\": \"1982-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"toyota starlet\", \"Miles_per_Gallon\": 39.1, \"Cylinders\": 4, \"Displacement\": 79.0, \"Horsepower\": 58.0, \"Weight_in_lbs\": 1755, \"Acceleration\": 16.9, \"Year\": \"1982-01-01T00:00:00\", \"Origin\": \"Japan\"}, {\"Name\": \"plymouth champ\", \"Miles_per_Gallon\": 39.0, \"Cylinders\": 4, \"Displacement\": 86.0, \"Horsepower\": 64.0, \"Weight_in_lbs\": 1875, \"Acceleration\": 16.4, \"Year\": \"1982-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"honda civic 1300\", \"Miles_per_Gallon\": 35.1, \"Cylinders\": 4, \"Displacement\": 81.0, \"Horsepower\": 60.0, \"Weight_in_lbs\": 1760, \"Acceleration\": 16.1, \"Year\": \"1982-01-01T00:00:00\", \"Origin\": \"Japan\"}, {\"Name\": \"subaru\", \"Miles_per_Gallon\": 32.3, \"Cylinders\": 4, \"Displacement\": 97.0, \"Horsepower\": 67.0, \"Weight_in_lbs\": 2065, \"Acceleration\": 17.8, \"Year\": \"1982-01-01T00:00:00\", \"Origin\": \"Japan\"}, {\"Name\": \"datsun 210\", \"Miles_per_Gallon\": 37.0, \"Cylinders\": 4, \"Displacement\": 85.0, \"Horsepower\": 65.0, \"Weight_in_lbs\": 1975, \"Acceleration\": 19.4, \"Year\": \"1982-01-01T00:00:00\", \"Origin\": \"Japan\"}, {\"Name\": \"toyota tercel\", \"Miles_per_Gallon\": 37.7, \"Cylinders\": 4, \"Displacement\": 89.0, \"Horsepower\": 62.0, \"Weight_in_lbs\": 2050, \"Acceleration\": 17.3, \"Year\": \"1982-01-01T00:00:00\", \"Origin\": \"Japan\"}, {\"Name\": \"mazda glc 4\", \"Miles_per_Gallon\": 34.1, \"Cylinders\": 4, \"Displacement\": 91.0, \"Horsepower\": 68.0, \"Weight_in_lbs\": 1985, \"Acceleration\": 16.0, \"Year\": \"1982-01-01T00:00:00\", \"Origin\": \"Japan\"}, {\"Name\": \"plymouth horizon 4\", \"Miles_per_Gallon\": 34.7, \"Cylinders\": 4, \"Displacement\": 105.0, \"Horsepower\": 63.0, \"Weight_in_lbs\": 2215, \"Acceleration\": 14.9, \"Year\": \"1982-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"ford escort 4w\", \"Miles_per_Gallon\": 34.4, \"Cylinders\": 4, \"Displacement\": 98.0, \"Horsepower\": 65.0, \"Weight_in_lbs\": 2045, \"Acceleration\": 16.2, \"Year\": \"1982-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"ford escort 2h\", \"Miles_per_Gallon\": 29.9, \"Cylinders\": 4, \"Displacement\": 98.0, \"Horsepower\": 65.0, \"Weight_in_lbs\": 2380, \"Acceleration\": 20.7, \"Year\": \"1982-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"volkswagen jetta\", \"Miles_per_Gallon\": 33.0, \"Cylinders\": 4, \"Displacement\": 105.0, \"Horsepower\": 74.0, \"Weight_in_lbs\": 2190, \"Acceleration\": 14.2, \"Year\": \"1982-01-01T00:00:00\", \"Origin\": \"Europe\"}, {\"Name\": \"renault 18i\", \"Miles_per_Gallon\": 34.5, \"Cylinders\": 4, \"Displacement\": 100.0, \"Horsepower\": null, \"Weight_in_lbs\": 2320, \"Acceleration\": 15.8, \"Year\": \"1982-01-01T00:00:00\", \"Origin\": \"Europe\"}, {\"Name\": \"honda prelude\", \"Miles_per_Gallon\": 33.7, \"Cylinders\": 4, \"Displacement\": 107.0, \"Horsepower\": 75.0, \"Weight_in_lbs\": 2210, \"Acceleration\": 14.4, \"Year\": \"1982-01-01T00:00:00\", \"Origin\": \"Japan\"}, {\"Name\": \"toyota corolla\", \"Miles_per_Gallon\": 32.4, \"Cylinders\": 4, \"Displacement\": 108.0, \"Horsepower\": 75.0, \"Weight_in_lbs\": 2350, \"Acceleration\": 16.8, \"Year\": \"1982-01-01T00:00:00\", \"Origin\": \"Japan\"}, {\"Name\": \"datsun 200sx\", \"Miles_per_Gallon\": 32.9, \"Cylinders\": 4, \"Displacement\": 119.0, \"Horsepower\": 100.0, \"Weight_in_lbs\": 2615, \"Acceleration\": 14.8, \"Year\": \"1982-01-01T00:00:00\", \"Origin\": \"Japan\"}, {\"Name\": \"mazda 626\", \"Miles_per_Gallon\": 31.6, \"Cylinders\": 4, \"Displacement\": 120.0, \"Horsepower\": 74.0, \"Weight_in_lbs\": 2635, \"Acceleration\": 18.3, \"Year\": \"1982-01-01T00:00:00\", \"Origin\": \"Japan\"}, {\"Name\": \"peugeot 505s turbo diesel\", \"Miles_per_Gallon\": 28.1, \"Cylinders\": 4, \"Displacement\": 141.0, \"Horsepower\": 80.0, \"Weight_in_lbs\": 3230, \"Acceleration\": 20.4, \"Year\": \"1982-01-01T00:00:00\", \"Origin\": \"Europe\"}, {\"Name\": \"saab 900s\", \"Miles_per_Gallon\": null, \"Cylinders\": 4, \"Displacement\": 121.0, \"Horsepower\": 110.0, \"Weight_in_lbs\": 2800, \"Acceleration\": 15.4, \"Year\": \"1982-01-01T00:00:00\", \"Origin\": \"Europe\"}, {\"Name\": \"volvo diesel\", \"Miles_per_Gallon\": 30.7, \"Cylinders\": 6, \"Displacement\": 145.0, \"Horsepower\": 76.0, \"Weight_in_lbs\": 3160, \"Acceleration\": 19.6, \"Year\": \"1982-01-01T00:00:00\", \"Origin\": \"Europe\"}, {\"Name\": \"toyota cressida\", \"Miles_per_Gallon\": 25.4, \"Cylinders\": 6, \"Displacement\": 168.0, \"Horsepower\": 116.0, \"Weight_in_lbs\": 2900, \"Acceleration\": 12.6, \"Year\": \"1982-01-01T00:00:00\", \"Origin\": \"Japan\"}, {\"Name\": \"datsun 810 maxima\", \"Miles_per_Gallon\": 24.2, \"Cylinders\": 6, \"Displacement\": 146.0, \"Horsepower\": 120.0, \"Weight_in_lbs\": 2930, \"Acceleration\": 13.8, \"Year\": \"1982-01-01T00:00:00\", \"Origin\": \"Japan\"}, {\"Name\": \"buick century\", \"Miles_per_Gallon\": 22.4, \"Cylinders\": 6, \"Displacement\": 231.0, \"Horsepower\": 110.0, \"Weight_in_lbs\": 3415, \"Acceleration\": 15.8, \"Year\": \"1982-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"oldsmobile cutlass ls\", \"Miles_per_Gallon\": 26.6, \"Cylinders\": 8, \"Displacement\": 350.0, \"Horsepower\": 105.0, \"Weight_in_lbs\": 3725, \"Acceleration\": 19.0, \"Year\": \"1982-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"ford granada gl\", \"Miles_per_Gallon\": 20.2, \"Cylinders\": 6, \"Displacement\": 200.0, \"Horsepower\": 88.0, \"Weight_in_lbs\": 3060, \"Acceleration\": 17.1, \"Year\": \"1982-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"chrysler lebaron salon\", \"Miles_per_Gallon\": 17.6, \"Cylinders\": 6, \"Displacement\": 225.0, \"Horsepower\": 85.0, \"Weight_in_lbs\": 3465, \"Acceleration\": 16.6, \"Year\": \"1982-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"chevrolet cavalier\", \"Miles_per_Gallon\": 28.0, \"Cylinders\": 4, \"Displacement\": 112.0, \"Horsepower\": 88.0, \"Weight_in_lbs\": 2605, \"Acceleration\": 19.6, \"Year\": \"1982-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"chevrolet cavalier wagon\", \"Miles_per_Gallon\": 27.0, \"Cylinders\": 4, \"Displacement\": 112.0, \"Horsepower\": 88.0, \"Weight_in_lbs\": 2640, \"Acceleration\": 18.6, \"Year\": \"1982-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"chevrolet cavalier 2-door\", \"Miles_per_Gallon\": 34.0, \"Cylinders\": 4, \"Displacement\": 112.0, \"Horsepower\": 88.0, \"Weight_in_lbs\": 2395, \"Acceleration\": 18.0, \"Year\": \"1982-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"pontiac j2000 se hatchback\", \"Miles_per_Gallon\": 31.0, \"Cylinders\": 4, \"Displacement\": 112.0, \"Horsepower\": 85.0, \"Weight_in_lbs\": 2575, \"Acceleration\": 16.2, \"Year\": \"1982-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"dodge aries se\", \"Miles_per_Gallon\": 29.0, \"Cylinders\": 4, \"Displacement\": 135.0, \"Horsepower\": 84.0, \"Weight_in_lbs\": 2525, \"Acceleration\": 16.0, \"Year\": \"1982-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"pontiac phoenix\", \"Miles_per_Gallon\": 27.0, \"Cylinders\": 4, \"Displacement\": 151.0, \"Horsepower\": 90.0, \"Weight_in_lbs\": 2735, \"Acceleration\": 18.0, \"Year\": \"1982-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"ford fairmont futura\", \"Miles_per_Gallon\": 24.0, \"Cylinders\": 4, \"Displacement\": 140.0, \"Horsepower\": 92.0, \"Weight_in_lbs\": 2865, \"Acceleration\": 16.4, \"Year\": \"1982-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"amc concord dl\", \"Miles_per_Gallon\": 23.0, \"Cylinders\": 4, \"Displacement\": 151.0, \"Horsepower\": null, \"Weight_in_lbs\": 3035, \"Acceleration\": 20.5, \"Year\": \"1982-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"volkswagen rabbit l\", \"Miles_per_Gallon\": 36.0, \"Cylinders\": 4, \"Displacement\": 105.0, \"Horsepower\": 74.0, \"Weight_in_lbs\": 1980, \"Acceleration\": 15.3, \"Year\": \"1982-01-01T00:00:00\", \"Origin\": \"Europe\"}, {\"Name\": \"mazda glc custom l\", \"Miles_per_Gallon\": 37.0, \"Cylinders\": 4, \"Displacement\": 91.0, \"Horsepower\": 68.0, \"Weight_in_lbs\": 2025, \"Acceleration\": 18.2, \"Year\": \"1982-01-01T00:00:00\", \"Origin\": \"Japan\"}, {\"Name\": \"mazda glc custom\", \"Miles_per_Gallon\": 31.0, \"Cylinders\": 4, \"Displacement\": 91.0, \"Horsepower\": 68.0, \"Weight_in_lbs\": 1970, \"Acceleration\": 17.6, \"Year\": \"1982-01-01T00:00:00\", \"Origin\": \"Japan\"}, {\"Name\": \"plymouth horizon miser\", \"Miles_per_Gallon\": 38.0, \"Cylinders\": 4, \"Displacement\": 105.0, \"Horsepower\": 63.0, \"Weight_in_lbs\": 2125, \"Acceleration\": 14.7, \"Year\": \"1982-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"mercury lynx l\", \"Miles_per_Gallon\": 36.0, \"Cylinders\": 4, \"Displacement\": 98.0, \"Horsepower\": 70.0, \"Weight_in_lbs\": 2125, \"Acceleration\": 17.3, \"Year\": \"1982-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"nissan stanza xe\", \"Miles_per_Gallon\": 36.0, \"Cylinders\": 4, \"Displacement\": 120.0, \"Horsepower\": 88.0, \"Weight_in_lbs\": 2160, \"Acceleration\": 14.5, \"Year\": \"1982-01-01T00:00:00\", \"Origin\": \"Japan\"}, {\"Name\": \"honda Accelerationord\", \"Miles_per_Gallon\": 36.0, \"Cylinders\": 4, \"Displacement\": 107.0, \"Horsepower\": 75.0, \"Weight_in_lbs\": 2205, \"Acceleration\": 14.5, \"Year\": \"1982-01-01T00:00:00\", \"Origin\": \"Japan\"}, {\"Name\": \"toyota corolla\", \"Miles_per_Gallon\": 34.0, \"Cylinders\": 4, \"Displacement\": 108.0, \"Horsepower\": 70.0, \"Weight_in_lbs\": 2245, \"Acceleration\": 16.9, \"Year\": \"1982-01-01T00:00:00\", \"Origin\": \"Japan\"}, {\"Name\": \"honda civic\", \"Miles_per_Gallon\": 38.0, \"Cylinders\": 4, \"Displacement\": 91.0, \"Horsepower\": 67.0, \"Weight_in_lbs\": 1965, \"Acceleration\": 15.0, \"Year\": \"1982-01-01T00:00:00\", \"Origin\": \"Japan\"}, {\"Name\": \"honda civic (auto)\", \"Miles_per_Gallon\": 32.0, \"Cylinders\": 4, \"Displacement\": 91.0, \"Horsepower\": 67.0, \"Weight_in_lbs\": 1965, \"Acceleration\": 15.7, \"Year\": \"1982-01-01T00:00:00\", \"Origin\": \"Japan\"}, {\"Name\": \"datsun 310 gx\", \"Miles_per_Gallon\": 38.0, \"Cylinders\": 4, \"Displacement\": 91.0, \"Horsepower\": 67.0, \"Weight_in_lbs\": 1995, \"Acceleration\": 16.2, \"Year\": \"1982-01-01T00:00:00\", \"Origin\": \"Japan\"}, {\"Name\": \"buick century limited\", \"Miles_per_Gallon\": 25.0, \"Cylinders\": 6, \"Displacement\": 181.0, \"Horsepower\": 110.0, \"Weight_in_lbs\": 2945, \"Acceleration\": 16.4, \"Year\": \"1982-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"oldsmobile cutlass ciera (diesel)\", \"Miles_per_Gallon\": 38.0, \"Cylinders\": 6, \"Displacement\": 262.0, \"Horsepower\": 85.0, \"Weight_in_lbs\": 3015, \"Acceleration\": 17.0, \"Year\": \"1982-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"chrysler lebaron medallion\", \"Miles_per_Gallon\": 26.0, \"Cylinders\": 4, \"Displacement\": 156.0, \"Horsepower\": 92.0, \"Weight_in_lbs\": 2585, \"Acceleration\": 14.5, \"Year\": \"1982-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"ford granada l\", \"Miles_per_Gallon\": 22.0, \"Cylinders\": 6, \"Displacement\": 232.0, \"Horsepower\": 112.0, \"Weight_in_lbs\": 2835, \"Acceleration\": 14.7, \"Year\": \"1982-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"toyota celica gt\", \"Miles_per_Gallon\": 32.0, \"Cylinders\": 4, \"Displacement\": 144.0, \"Horsepower\": 96.0, \"Weight_in_lbs\": 2665, \"Acceleration\": 13.9, \"Year\": \"1982-01-01T00:00:00\", \"Origin\": \"Japan\"}, {\"Name\": \"dodge charger 2.2\", \"Miles_per_Gallon\": 36.0, \"Cylinders\": 4, \"Displacement\": 135.0, \"Horsepower\": 84.0, \"Weight_in_lbs\": 2370, \"Acceleration\": 13.0, \"Year\": \"1982-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"chevrolet camaro\", \"Miles_per_Gallon\": 27.0, \"Cylinders\": 4, \"Displacement\": 151.0, \"Horsepower\": 90.0, \"Weight_in_lbs\": 2950, \"Acceleration\": 17.3, \"Year\": \"1982-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"ford mustang gl\", \"Miles_per_Gallon\": 27.0, \"Cylinders\": 4, \"Displacement\": 140.0, \"Horsepower\": 86.0, \"Weight_in_lbs\": 2790, \"Acceleration\": 15.6, \"Year\": \"1982-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"vw pickup\", \"Miles_per_Gallon\": 44.0, \"Cylinders\": 4, \"Displacement\": 97.0, \"Horsepower\": 52.0, \"Weight_in_lbs\": 2130, \"Acceleration\": 24.6, \"Year\": \"1982-01-01T00:00:00\", \"Origin\": \"Europe\"}, {\"Name\": \"dodge rampage\", \"Miles_per_Gallon\": 32.0, \"Cylinders\": 4, \"Displacement\": 135.0, \"Horsepower\": 84.0, \"Weight_in_lbs\": 2295, \"Acceleration\": 11.6, \"Year\": \"1982-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"ford ranger\", \"Miles_per_Gallon\": 28.0, \"Cylinders\": 4, \"Displacement\": 120.0, \"Horsepower\": 79.0, \"Weight_in_lbs\": 2625, \"Acceleration\": 18.6, \"Year\": \"1982-01-01T00:00:00\", \"Origin\": \"USA\"}, {\"Name\": \"chevy s-10\", \"Miles_per_Gallon\": 31.0, \"Cylinders\": 4, \"Displacement\": 119.0, \"Horsepower\": 82.0, \"Weight_in_lbs\": 2720, \"Acceleration\": 19.4, \"Year\": \"1982-01-01T00:00:00\", \"Origin\": \"USA\"}]}}, {\"mode\": \"vega-lite\"});\n",
       "</script>"
      ],
      "text/plain": [
       "alt.RepeatChart(...)"
      ]
     },
     "execution_count": 154,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "#from vega_datasets import data\n",
    "source = data.cars()\n",
    "\n",
    "alt.Chart(source).mark_circle().encode(\n",
    "    alt.X(alt.repeat(\"column\"), type='quantitative'),\n",
    "    alt.Y(alt.repeat(\"row\"), type='quantitative'),\n",
    "    color='Origin:N'\n",
    ").properties(\n",
    "    width=100,\n",
    "    height=100\n",
    ").repeat(\n",
    "    row=['Horsepower', 'Acceleration', 'Miles_per_Gallon'],\n",
    "    column=['Miles_per_Gallon', 'Acceleration', 'Horsepower']\n",
    ").interactive()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 73,
   "metadata": {},
   "outputs": [],
   "source": [
    "#茎叶图"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 76,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "\n",
       "<div id=\"altair-viz-7e4016483793470390ff7f54702dc449\"></div>\n",
       "<script type=\"text/javascript\">\n",
       "  (function(spec, embedOpt){\n",
       "    const outputDiv = document.getElementById(\"altair-viz-7e4016483793470390ff7f54702dc449\");\n",
       "    const paths = {\n",
       "      \"vega\": \"https://cdn.jsdelivr.net/npm//vega@5?noext\",\n",
       "      \"vega-lib\": \"https://cdn.jsdelivr.net/npm//vega-lib?noext\",\n",
       "      \"vega-lite\": \"https://cdn.jsdelivr.net/npm//vega-lite@4.0.2?noext\",\n",
       "      \"vega-embed\": \"https://cdn.jsdelivr.net/npm//vega-embed@6?noext\",\n",
       "    };\n",
       "\n",
       "    function loadScript(lib) {\n",
       "      return new Promise(function(resolve, reject) {\n",
       "        var s = document.createElement('script');\n",
       "        s.src = paths[lib];\n",
       "        s.async = true;\n",
       "        s.onload = () => resolve(paths[lib]);\n",
       "        s.onerror = () => reject(`Error loading script: ${paths[lib]}`);\n",
       "        document.getElementsByTagName(\"head\")[0].appendChild(s);\n",
       "      });\n",
       "    }\n",
       "\n",
       "    function showError(err) {\n",
       "      outputDiv.innerHTML = `<div class=\"error\" style=\"color:red;\">${err}</div>`;\n",
       "      throw err;\n",
       "    }\n",
       "\n",
       "    function displayChart(vegaEmbed) {\n",
       "      vegaEmbed(outputDiv, spec, embedOpt)\n",
       "        .catch(err => showError(`Javascript Error: ${err.message}<br>This usually means there's a typo in your chart specification. See the javascript console for the full traceback.`));\n",
       "    }\n",
       "\n",
       "    if(typeof define === \"function\" && define.amd) {\n",
       "      requirejs.config({paths});\n",
       "      require([\"vega-embed\"], displayChart, err => showError(`Error loading script: ${err.message}`));\n",
       "    } else if (typeof vegaEmbed === \"function\") {\n",
       "      displayChart(vegaEmbed);\n",
       "    } else {\n",
       "      loadScript(\"vega\")\n",
       "        .then(() => loadScript(\"vega-lite\"))\n",
       "        .then(() => loadScript(\"vega-embed\"))\n",
       "        .catch(showError)\n",
       "        .then(() => displayChart(vegaEmbed));\n",
       "    }\n",
       "  })({\"config\": {\"view\": {\"continuousWidth\": 400, \"continuousHeight\": 300}, \"axis\": {\"labelFontSize\": 20}, \"text\": {\"fontSize\": 20}}, \"data\": {\"name\": \"data-d9af3a832f1e04bce0505540689d8c73\"}, \"mark\": {\"type\": \"text\", \"align\": \"left\", \"baseline\": \"middle\", \"dx\": -5}, \"encoding\": {\"text\": {\"type\": \"nominal\", \"field\": \"leaf\"}, \"x\": {\"type\": \"quantitative\", \"axis\": {\"grid\": false, \"labels\": false, \"ticks\": false}, \"field\": \"position\", \"title\": \"\"}, \"y\": {\"type\": \"nominal\", \"axis\": {\"tickSize\": 0}, \"field\": \"stem\", \"title\": \"\"}}, \"height\": 150, \"selection\": {\"selector033\": {\"type\": \"interval\", \"bind\": \"scales\", \"encodings\": [\"x\", \"y\"]}}, \"$schema\": \"https://vega.github.io/schema/vega-lite/v4.0.2.json\", \"datasets\": {\"data-d9af3a832f1e04bce0505540689d8c73\": [{\"Name\": \"honda civic cvcc\", \"Miles_per_Gallon\": 33.0, \"Cylinders\": 4, \"Displacement\": 91.0, \"Horsepower\": 53.0, \"Weight_in_lbs\": 1795, \"Acceleration\": 17.5, \"Year\": \"1975-01-01T00:00:00\", \"Origin\": \"Japan\", \"stem\": \"1\", \"leaf\": \"7\", \"position\": 1}, {\"Name\": \"honda Accelerationord cvcc\", \"Miles_per_Gallon\": 31.5, \"Cylinders\": 4, \"Displacement\": 98.0, \"Horsepower\": 68.0, \"Weight_in_lbs\": 2045, \"Acceleration\": 18.5, \"Year\": \"1977-01-01T00:00:00\", \"Origin\": \"Japan\", \"stem\": \"2\", \"leaf\": \"0\", \"position\": 1}, {\"Name\": \"chevrolet chevette\", \"Miles_per_Gallon\": 32.1, \"Cylinders\": 4, \"Displacement\": 98.0, \"Horsepower\": 70.0, \"Weight_in_lbs\": 2120, \"Acceleration\": 15.5, \"Year\": \"1980-01-01T00:00:00\", \"Origin\": \"USA\", \"stem\": \"2\", \"leaf\": \"1\", \"position\": 2}, {\"Name\": \"vw pickup\", \"Miles_per_Gallon\": 44.0, \"Cylinders\": 4, \"Displacement\": 97.0, \"Horsepower\": 52.0, \"Weight_in_lbs\": 2130, \"Acceleration\": 24.6, \"Year\": \"1982-01-01T00:00:00\", \"Origin\": \"Europe\", \"stem\": \"2\", \"leaf\": \"1\", \"position\": 3}, {\"Name\": \"dodge colt\", \"Miles_per_Gallon\": 28.0, \"Cylinders\": 4, \"Displacement\": 90.0, \"Horsepower\": 75.0, \"Weight_in_lbs\": 2125, \"Acceleration\": 14.5, \"Year\": \"1974-01-01T00:00:00\", \"Origin\": \"USA\", \"stem\": \"2\", \"leaf\": \"1\", \"position\": 4}, {\"Name\": \"subaru dl\", \"Miles_per_Gallon\": 33.8, \"Cylinders\": 4, \"Displacement\": 97.0, \"Horsepower\": 67.0, \"Weight_in_lbs\": 2145, \"Acceleration\": 18.0, \"Year\": \"1980-01-01T00:00:00\", \"Origin\": \"Japan\", \"stem\": \"2\", \"leaf\": \"1\", \"position\": 5}, {\"Name\": \"toyota corolla\", \"Miles_per_Gallon\": 34.0, \"Cylinders\": 4, \"Displacement\": 108.0, \"Horsepower\": 70.0, \"Weight_in_lbs\": 2245, \"Acceleration\": 16.9, \"Year\": \"1982-01-01T00:00:00\", \"Origin\": \"Japan\", \"stem\": \"2\", \"leaf\": \"2\", \"position\": 6}, {\"Name\": \"dodge omni\", \"Miles_per_Gallon\": 30.9, \"Cylinders\": 4, \"Displacement\": 105.0, \"Horsepower\": 75.0, \"Weight_in_lbs\": 2230, \"Acceleration\": 14.5, \"Year\": \"1978-01-01T00:00:00\", \"Origin\": \"USA\", \"stem\": \"2\", \"leaf\": \"2\", \"position\": 7}, {\"Name\": \"plymouth horizon\", \"Miles_per_Gallon\": 34.2, \"Cylinders\": 4, \"Displacement\": 105.0, \"Horsepower\": 70.0, \"Weight_in_lbs\": 2200, \"Acceleration\": 13.2, \"Year\": \"1979-01-01T00:00:00\", \"Origin\": \"USA\", \"stem\": \"2\", \"leaf\": \"2\", \"position\": 8}, {\"Name\": \"toyota corolla liftback\", \"Miles_per_Gallon\": 26.0, \"Cylinders\": 4, \"Displacement\": 97.0, \"Horsepower\": 75.0, \"Weight_in_lbs\": 2265, \"Acceleration\": 18.2, \"Year\": \"1977-01-01T00:00:00\", \"Origin\": \"Japan\", \"stem\": \"2\", \"leaf\": \"2\", \"position\": 9}, {\"Name\": \"volkswagen dasher\", \"Miles_per_Gallon\": 25.0, \"Cylinders\": 4, \"Displacement\": 90.0, \"Horsepower\": 71.0, \"Weight_in_lbs\": 2223, \"Acceleration\": 16.5, \"Year\": \"1975-01-01T00:00:00\", \"Origin\": \"Europe\", \"stem\": \"2\", \"leaf\": \"2\", \"position\": 10}, {\"Name\": \"opel manta\", \"Miles_per_Gallon\": 26.0, \"Cylinders\": 4, \"Displacement\": 97.0, \"Horsepower\": 78.0, \"Weight_in_lbs\": 2300, \"Acceleration\": 14.5, \"Year\": \"1974-01-01T00:00:00\", \"Origin\": \"Europe\", \"stem\": \"2\", \"leaf\": \"3\", \"position\": 11}, {\"Name\": \"subaru\", \"Miles_per_Gallon\": 26.0, \"Cylinders\": 4, \"Displacement\": 108.0, \"Horsepower\": 93.0, \"Weight_in_lbs\": 2391, \"Acceleration\": 15.5, \"Year\": \"1974-01-01T00:00:00\", \"Origin\": \"Japan\", \"stem\": \"2\", \"leaf\": \"3\", \"position\": 12}, {\"Name\": \"mazda rx-7 gs\", \"Miles_per_Gallon\": 23.7, \"Cylinders\": 3, \"Displacement\": 70.0, \"Horsepower\": 100.0, \"Weight_in_lbs\": 2420, \"Acceleration\": 12.5, \"Year\": \"1980-01-01T00:00:00\", \"Origin\": \"Japan\", \"stem\": \"2\", \"leaf\": \"4\", \"position\": 13}, {\"Name\": \"chrysler lebaron medallion\", \"Miles_per_Gallon\": 26.0, \"Cylinders\": 4, \"Displacement\": 156.0, \"Horsepower\": 92.0, \"Weight_in_lbs\": 2585, \"Acceleration\": 14.5, \"Year\": \"1982-01-01T00:00:00\", \"Origin\": \"USA\", \"stem\": \"2\", \"leaf\": \"5\", \"position\": 14}, {\"Name\": \"toyota celica gt liftback\", \"Miles_per_Gallon\": 21.1, \"Cylinders\": 4, \"Displacement\": 134.0, \"Horsepower\": 95.0, \"Weight_in_lbs\": 2515, \"Acceleration\": 14.8, \"Year\": \"1978-01-01T00:00:00\", \"Origin\": \"Japan\", \"stem\": \"2\", \"leaf\": \"5\", \"position\": 15}, {\"Name\": \"mazda 626\", \"Miles_per_Gallon\": 31.3, \"Cylinders\": 4, \"Displacement\": 120.0, \"Horsepower\": 75.0, \"Weight_in_lbs\": 2542, \"Acceleration\": 17.5, \"Year\": \"1980-01-01T00:00:00\", \"Origin\": \"Japan\", \"stem\": \"2\", \"leaf\": \"5\", \"position\": 16}, {\"Name\": \"dodge aries wagon (sw)\", \"Miles_per_Gallon\": 25.8, \"Cylinders\": 4, \"Displacement\": 156.0, \"Horsepower\": 92.0, \"Weight_in_lbs\": 2620, \"Acceleration\": 14.4, \"Year\": \"1982-01-01T00:00:00\", \"Origin\": \"USA\", \"stem\": \"2\", \"leaf\": \"6\", \"position\": 17}, {\"Name\": \"amc gremlin\", \"Miles_per_Gallon\": 18.0, \"Cylinders\": 6, \"Displacement\": 232.0, \"Horsepower\": 100.0, \"Weight_in_lbs\": 2789, \"Acceleration\": 15.0, \"Year\": \"1973-01-01T00:00:00\", \"Origin\": \"USA\", \"stem\": \"2\", \"leaf\": \"7\", \"position\": 18}, {\"Name\": \"ford mustang gl\", \"Miles_per_Gallon\": 27.0, \"Cylinders\": 4, \"Displacement\": 140.0, \"Horsepower\": 86.0, \"Weight_in_lbs\": 2790, \"Acceleration\": 15.6, \"Year\": \"1982-01-01T00:00:00\", \"Origin\": \"USA\", \"stem\": \"2\", \"leaf\": \"7\", \"position\": 19}, {\"Name\": \"datsun 810\", \"Miles_per_Gallon\": 22.0, \"Cylinders\": 6, \"Displacement\": 146.0, \"Horsepower\": 97.0, \"Weight_in_lbs\": 2815, \"Acceleration\": 14.5, \"Year\": \"1977-01-01T00:00:00\", \"Origin\": \"Japan\", \"stem\": \"2\", \"leaf\": \"8\", \"position\": 20}, {\"Name\": \"audi 5000\", \"Miles_per_Gallon\": 20.3, \"Cylinders\": 5, \"Displacement\": 131.0, \"Horsepower\": 103.0, \"Weight_in_lbs\": 2830, \"Acceleration\": 15.9, \"Year\": \"1978-01-01T00:00:00\", \"Origin\": \"Europe\", \"stem\": \"2\", \"leaf\": \"8\", \"position\": 21}, {\"Name\": \"citroen ds-21 pallas\", \"Miles_per_Gallon\": null, \"Cylinders\": 4, \"Displacement\": 133.0, \"Horsepower\": 115.0, \"Weight_in_lbs\": 3090, \"Acceleration\": 17.5, \"Year\": \"1970-01-01T00:00:00\", \"Origin\": \"Europe\", \"stem\": \"3\", \"leaf\": \"0\", \"position\": 1}, {\"Name\": \"ford maverick\", \"Miles_per_Gallon\": 24.0, \"Cylinders\": 6, \"Displacement\": 200.0, \"Horsepower\": 81.0, \"Weight_in_lbs\": 3012, \"Acceleration\": 17.6, \"Year\": \"1976-01-01T00:00:00\", \"Origin\": \"USA\", \"stem\": \"3\", \"leaf\": \"0\", \"position\": 2}, {\"Name\": \"amc concord dl\", \"Miles_per_Gallon\": 23.0, \"Cylinders\": 4, \"Displacement\": 151.0, \"Horsepower\": null, \"Weight_in_lbs\": 3035, \"Acceleration\": 20.5, \"Year\": \"1982-01-01T00:00:00\", \"Origin\": \"USA\", \"stem\": \"3\", \"leaf\": \"0\", \"position\": 3}, {\"Name\": \"pontiac firebird\", \"Miles_per_Gallon\": 19.0, \"Cylinders\": 6, \"Displacement\": 250.0, \"Horsepower\": 100.0, \"Weight_in_lbs\": 3282, \"Acceleration\": 15.0, \"Year\": \"1971-01-01T00:00:00\", \"Origin\": \"USA\", \"stem\": \"3\", \"leaf\": \"2\", \"position\": 4}, {\"Name\": \"peugeot 504\", \"Miles_per_Gallon\": 19.0, \"Cylinders\": 4, \"Displacement\": 120.0, \"Horsepower\": 88.0, \"Weight_in_lbs\": 3270, \"Acceleration\": 21.9, \"Year\": \"1976-01-01T00:00:00\", \"Origin\": \"Europe\", \"stem\": \"3\", \"leaf\": \"2\", \"position\": 5}, {\"Name\": \"chevrolet nova\", \"Miles_per_Gallon\": 22.0, \"Cylinders\": 6, \"Displacement\": 250.0, \"Horsepower\": 105.0, \"Weight_in_lbs\": 3353, \"Acceleration\": 14.5, \"Year\": \"1976-01-01T00:00:00\", \"Origin\": \"USA\", \"stem\": \"3\", \"leaf\": \"3\", \"position\": 6}, {\"Name\": \"buick century special\", \"Miles_per_Gallon\": 20.6, \"Cylinders\": 6, \"Displacement\": 231.0, \"Horsepower\": 105.0, \"Weight_in_lbs\": 3380, \"Acceleration\": 15.8, \"Year\": \"1978-01-01T00:00:00\", \"Origin\": \"USA\", \"stem\": \"3\", \"leaf\": \"3\", \"position\": 7}, {\"Name\": \"chrysler lebaron salon\", \"Miles_per_Gallon\": 17.6, \"Cylinders\": 6, \"Displacement\": 225.0, \"Horsepower\": 85.0, \"Weight_in_lbs\": 3465, \"Acceleration\": 16.6, \"Year\": \"1982-01-01T00:00:00\", \"Origin\": \"USA\", \"stem\": \"3\", \"leaf\": \"4\", \"position\": 8}, {\"Name\": \"buick regal sport coupe (turbo)\", \"Miles_per_Gallon\": 17.7, \"Cylinders\": 6, \"Displacement\": 231.0, \"Horsepower\": 165.0, \"Weight_in_lbs\": 3445, \"Acceleration\": 13.4, \"Year\": \"1978-01-01T00:00:00\", \"Origin\": \"USA\", \"stem\": \"3\", \"leaf\": \"4\", \"position\": 9}, {\"Name\": \"dodge challenger se\", \"Miles_per_Gallon\": 15.0, \"Cylinders\": 8, \"Displacement\": 383.0, \"Horsepower\": 170.0, \"Weight_in_lbs\": 3563, \"Acceleration\": 10.0, \"Year\": \"1970-01-01T00:00:00\", \"Origin\": \"USA\", \"stem\": \"3\", \"leaf\": \"5\", \"position\": 10}, {\"Name\": \"chevrolet concours\", \"Miles_per_Gallon\": 17.5, \"Cylinders\": 6, \"Displacement\": 250.0, \"Horsepower\": 110.0, \"Weight_in_lbs\": 3520, \"Acceleration\": 16.4, \"Year\": \"1977-01-01T00:00:00\", \"Origin\": \"USA\", \"stem\": \"3\", \"leaf\": \"5\", \"position\": 11}, {\"Name\": \"chevrolet malibu\", \"Miles_per_Gallon\": 13.0, \"Cylinders\": 8, \"Displacement\": 350.0, \"Horsepower\": 145.0, \"Weight_in_lbs\": 3988, \"Acceleration\": 13.0, \"Year\": \"1973-01-01T00:00:00\", \"Origin\": \"USA\", \"stem\": \"3\", \"leaf\": \"9\", \"position\": 12}, {\"Name\": \"chevy c10\", \"Miles_per_Gallon\": 13.0, \"Cylinders\": 8, \"Displacement\": 350.0, \"Horsepower\": 145.0, \"Weight_in_lbs\": 4055, \"Acceleration\": 12.0, \"Year\": \"1976-01-01T00:00:00\", \"Origin\": \"USA\", \"stem\": \"4\", \"leaf\": \"0\", \"position\": 1}, {\"Name\": \"chevrolet monte carlo landau\", \"Miles_per_Gallon\": 15.5, \"Cylinders\": 8, \"Displacement\": 350.0, \"Horsepower\": 170.0, \"Weight_in_lbs\": 4165, \"Acceleration\": 11.4, \"Year\": \"1977-01-01T00:00:00\", \"Origin\": \"USA\", \"stem\": \"4\", \"leaf\": \"1\", \"position\": 2}, {\"Name\": \"plymouth fury gran sedan\", \"Miles_per_Gallon\": 14.0, \"Cylinders\": 8, \"Displacement\": 318.0, \"Horsepower\": 150.0, \"Weight_in_lbs\": 4237, \"Acceleration\": 14.5, \"Year\": \"1973-01-01T00:00:00\", \"Origin\": \"USA\", \"stem\": \"4\", \"leaf\": \"2\", \"position\": 3}, {\"Name\": \"plymouth fury iii\", \"Miles_per_Gallon\": 14.0, \"Cylinders\": 8, \"Displacement\": 440.0, \"Horsepower\": 215.0, \"Weight_in_lbs\": 4312, \"Acceleration\": 8.5, \"Year\": \"1970-01-01T00:00:00\", \"Origin\": \"USA\", \"stem\": \"4\", \"leaf\": \"3\", \"position\": 4}, {\"Name\": \"plymouth grand fury\", \"Miles_per_Gallon\": 16.0, \"Cylinders\": 8, \"Displacement\": 318.0, \"Horsepower\": 150.0, \"Weight_in_lbs\": 4498, \"Acceleration\": 14.5, \"Year\": \"1975-01-01T00:00:00\", \"Origin\": \"USA\", \"stem\": \"4\", \"leaf\": \"4\", \"position\": 5}, {\"Name\": \"ford gran torino (sw)\", \"Miles_per_Gallon\": 14.0, \"Cylinders\": 8, \"Displacement\": 302.0, \"Horsepower\": 140.0, \"Weight_in_lbs\": 4638, \"Acceleration\": 16.0, \"Year\": \"1974-01-01T00:00:00\", \"Origin\": \"USA\", \"stem\": \"4\", \"leaf\": \"6\", \"position\": 6}]}}, {\"mode\": \"vega-lite\"});\n",
       "</script>"
      ],
      "text/plain": [
       "alt.Chart(...)"
      ]
     },
     "execution_count": 76,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "s2=source.sample(40)\n",
    "s2['stem'] = s2['Weight_in_lbs'].apply(lambda x:str(x)[0])\n",
    "s2['leaf'] = s2['Weight_in_lbs'].apply(lambda x:str(x)[1])\n",
    "\n",
    "s2 = s2.sort_values(by=['stem', 'leaf'])\n",
    "\n",
    "s2['position'] = s2.groupby('stem').cumcount().add(1)\n",
    "\n",
    "alt.Chart(s2,height=150).mark_text(\n",
    "    align='left',\n",
    "    baseline='middle',\n",
    "    dx=-5\n",
    ").encode(\n",
    "    alt.X('position:Q', title='',\n",
    "        axis=alt.Axis(ticks=False, labels=False, grid=False)\n",
    "    ),\n",
    "    alt.Y('stem:N', title='', axis=alt.Axis(tickSize=0)),\n",
    "    text='leaf:N',\n",
    ").configure_axis(\n",
    "    labelFontSize=20\n",
    ").configure_text(fontSize=20).interactive()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 深入使用"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "#棒棒糖图"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [],
   "source": [
    "y = [3.9, 4.4, 10.8, 10.3, 11.2, 13.1, 14.1,  9.9, 13.9, 15.1, 12.5]\n",
    "x=['c'+str(i) for i in range(len(y))]\n",
    "d2=pd.DataFrame({'x':x,'y':y})"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "\n",
       "<div id=\"altair-viz-85ff0d49fa7d48488ef2ad38edb62bc9\"></div>\n",
       "<script type=\"text/javascript\">\n",
       "  (function(spec, embedOpt){\n",
       "    const outputDiv = document.getElementById(\"altair-viz-85ff0d49fa7d48488ef2ad38edb62bc9\");\n",
       "    const paths = {\n",
       "      \"vega\": \"https://cdn.jsdelivr.net/npm//vega@5?noext\",\n",
       "      \"vega-lib\": \"https://cdn.jsdelivr.net/npm//vega-lib?noext\",\n",
       "      \"vega-lite\": \"https://cdn.jsdelivr.net/npm//vega-lite@4.0.2?noext\",\n",
       "      \"vega-embed\": \"https://cdn.jsdelivr.net/npm//vega-embed@6?noext\",\n",
       "    };\n",
       "\n",
       "    function loadScript(lib) {\n",
       "      return new Promise(function(resolve, reject) {\n",
       "        var s = document.createElement('script');\n",
       "        s.src = paths[lib];\n",
       "        s.async = true;\n",
       "        s.onload = () => resolve(paths[lib]);\n",
       "        s.onerror = () => reject(`Error loading script: ${paths[lib]}`);\n",
       "        document.getElementsByTagName(\"head\")[0].appendChild(s);\n",
       "      });\n",
       "    }\n",
       "\n",
       "    function showError(err) {\n",
       "      outputDiv.innerHTML = `<div class=\"error\" style=\"color:red;\">${err}</div>`;\n",
       "      throw err;\n",
       "    }\n",
       "\n",
       "    function displayChart(vegaEmbed) {\n",
       "      vegaEmbed(outputDiv, spec, embedOpt)\n",
       "        .catch(err => showError(`Javascript Error: ${err.message}<br>This usually means there's a typo in your chart specification. See the javascript console for the full traceback.`));\n",
       "    }\n",
       "\n",
       "    if(typeof define === \"function\" && define.amd) {\n",
       "      requirejs.config({paths});\n",
       "      require([\"vega-embed\"], displayChart, err => showError(`Error loading script: ${err.message}`));\n",
       "    } else if (typeof vegaEmbed === \"function\") {\n",
       "      displayChart(vegaEmbed);\n",
       "    } else {\n",
       "      loadScript(\"vega\")\n",
       "        .then(() => loadScript(\"vega-lite\"))\n",
       "        .then(() => loadScript(\"vega-embed\"))\n",
       "        .catch(showError)\n",
       "        .then(() => displayChart(vegaEmbed));\n",
       "    }\n",
       "  })({\"config\": {\"view\": {\"continuousWidth\": 400, \"continuousHeight\": 300}}, \"layer\": [{\"mark\": {\"type\": \"bar\", \"height\": 2}, \"encoding\": {\"x\": {\"type\": \"quantitative\", \"field\": \"y\"}, \"y\": {\"type\": \"nominal\", \"field\": \"x\"}}}, {\"mark\": {\"type\": \"point\", \"filled\": true}, \"encoding\": {\"x\": {\"type\": \"quantitative\", \"field\": \"y\"}, \"y\": {\"type\": \"nominal\", \"field\": \"x\"}}}], \"data\": {\"name\": \"data-b40f02f68cd3c5b942421d25211066de\"}, \"$schema\": \"https://vega.github.io/schema/vega-lite/v4.0.2.json\", \"datasets\": {\"data-b40f02f68cd3c5b942421d25211066de\": [{\"x\": \"c0\", \"y\": 3.9}, {\"x\": \"c1\", \"y\": 4.4}, {\"x\": \"c2\", \"y\": 10.8}, {\"x\": \"c3\", \"y\": 10.3}, {\"x\": \"c4\", \"y\": 11.2}, {\"x\": \"c5\", \"y\": 13.1}, {\"x\": \"c6\", \"y\": 14.1}, {\"x\": \"c7\", \"y\": 9.9}, {\"x\": \"c8\", \"y\": 13.9}, {\"x\": \"c9\", \"y\": 15.1}, {\"x\": \"c10\", \"y\": 12.5}]}}, {\"mode\": \"vega-lite\"});\n",
       "</script>"
      ],
      "text/plain": [
       "alt.LayerChart(...)"
      ]
     },
     "execution_count": 14,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "#组合图\n",
    "#写法1\n",
    "bar= alt.Chart(d2).mark_bar(height=2).encode(x='y',y='x')\n",
    "point = alt.Chart(d2).mark_point(filled=True).encode(x='y',y='x')\n",
    "bar + point #还是存在顺序问题？ 好像是透明度的问题"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 99,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "\n",
       "<div id=\"altair-viz-5954ddeba693400ca7edb02596e67c50\"></div>\n",
       "<script type=\"text/javascript\">\n",
       "  (function(spec, embedOpt){\n",
       "    const outputDiv = document.getElementById(\"altair-viz-5954ddeba693400ca7edb02596e67c50\");\n",
       "    const paths = {\n",
       "      \"vega\": \"https://cdn.jsdelivr.net/npm//vega@5?noext\",\n",
       "      \"vega-lib\": \"https://cdn.jsdelivr.net/npm//vega-lib?noext\",\n",
       "      \"vega-lite\": \"https://cdn.jsdelivr.net/npm//vega-lite@4.0.2?noext\",\n",
       "      \"vega-embed\": \"https://cdn.jsdelivr.net/npm//vega-embed@6?noext\",\n",
       "    };\n",
       "\n",
       "    function loadScript(lib) {\n",
       "      return new Promise(function(resolve, reject) {\n",
       "        var s = document.createElement('script');\n",
       "        s.src = paths[lib];\n",
       "        s.async = true;\n",
       "        s.onload = () => resolve(paths[lib]);\n",
       "        s.onerror = () => reject(`Error loading script: ${paths[lib]}`);\n",
       "        document.getElementsByTagName(\"head\")[0].appendChild(s);\n",
       "      });\n",
       "    }\n",
       "\n",
       "    function showError(err) {\n",
       "      outputDiv.innerHTML = `<div class=\"error\" style=\"color:red;\">${err}</div>`;\n",
       "      throw err;\n",
       "    }\n",
       "\n",
       "    function displayChart(vegaEmbed) {\n",
       "      vegaEmbed(outputDiv, spec, embedOpt)\n",
       "        .catch(err => showError(`Javascript Error: ${err.message}<br>This usually means there's a typo in your chart specification. See the javascript console for the full traceback.`));\n",
       "    }\n",
       "\n",
       "    if(typeof define === \"function\" && define.amd) {\n",
       "      requirejs.config({paths});\n",
       "      require([\"vega-embed\"], displayChart, err => showError(`Error loading script: ${err.message}`));\n",
       "    } else if (typeof vegaEmbed === \"function\") {\n",
       "      displayChart(vegaEmbed);\n",
       "    } else {\n",
       "      loadScript(\"vega\")\n",
       "        .then(() => loadScript(\"vega-lite\"))\n",
       "        .then(() => loadScript(\"vega-embed\"))\n",
       "        .catch(showError)\n",
       "        .then(() => displayChart(vegaEmbed));\n",
       "    }\n",
       "  })({\"config\": {\"view\": {\"height\": 300, \"width\": 400}, \"mark\": {\"color\": \"#1eafae\", \"fill\": \"#1eafae\"}}, \"layer\": [{\"mark\": {\"type\": \"bar\", \"height\": 2}, \"encoding\": {\"x\": {\"type\": \"quantitative\", \"field\": \"y\"}, \"y\": {\"type\": \"nominal\", \"field\": \"x\"}}}, {\"mark\": \"circle\", \"encoding\": {\"x\": {\"type\": \"quantitative\", \"field\": \"y\"}, \"y\": {\"type\": \"nominal\", \"field\": \"x\"}}}], \"data\": {\"name\": \"data-b40f02f68cd3c5b942421d25211066de\"}, \"$schema\": \"https://vega.github.io/schema/vega-lite/v4.0.2.json\", \"datasets\": {\"data-b40f02f68cd3c5b942421d25211066de\": [{\"x\": \"c0\", \"y\": 3.9}, {\"x\": \"c1\", \"y\": 4.4}, {\"x\": \"c2\", \"y\": 10.8}, {\"x\": \"c3\", \"y\": 10.3}, {\"x\": \"c4\", \"y\": 11.2}, {\"x\": \"c5\", \"y\": 13.1}, {\"x\": \"c6\", \"y\": 14.1}, {\"x\": \"c7\", \"y\": 9.9}, {\"x\": \"c8\", \"y\": 13.9}, {\"x\": \"c9\", \"y\": 15.1}, {\"x\": \"c10\", \"y\": 12.5}]}}, {\"mode\": \"vega-lite\"});\n",
       "</script>"
      ],
      "text/plain": [
       "alt.LayerChart(...)"
      ]
     },
     "execution_count": 99,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "#写法2\n",
    "bar= alt.Chart(d2).mark_bar(height=2).encode(x='y',y='x')\n",
    "bar + bar.mark_circle()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 29,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "\n",
       "<div id=\"altair-viz-5ccdbe71395d4cd398a4cd3845ed947c\"></div>\n",
       "<script type=\"text/javascript\">\n",
       "  (function(spec, embedOpt){\n",
       "    const outputDiv = document.getElementById(\"altair-viz-5ccdbe71395d4cd398a4cd3845ed947c\");\n",
       "    const paths = {\n",
       "      \"vega\": \"https://cdn.jsdelivr.net/npm//vega@5?noext\",\n",
       "      \"vega-lib\": \"https://cdn.jsdelivr.net/npm//vega-lib?noext\",\n",
       "      \"vega-lite\": \"https://cdn.jsdelivr.net/npm//vega-lite@4.0.2?noext\",\n",
       "      \"vega-embed\": \"https://cdn.jsdelivr.net/npm//vega-embed@6?noext\",\n",
       "    };\n",
       "\n",
       "    function loadScript(lib) {\n",
       "      return new Promise(function(resolve, reject) {\n",
       "        var s = document.createElement('script');\n",
       "        s.src = paths[lib];\n",
       "        s.async = true;\n",
       "        s.onload = () => resolve(paths[lib]);\n",
       "        s.onerror = () => reject(`Error loading script: ${paths[lib]}`);\n",
       "        document.getElementsByTagName(\"head\")[0].appendChild(s);\n",
       "      });\n",
       "    }\n",
       "\n",
       "    function showError(err) {\n",
       "      outputDiv.innerHTML = `<div class=\"error\" style=\"color:red;\">${err}</div>`;\n",
       "      throw err;\n",
       "    }\n",
       "\n",
       "    function displayChart(vegaEmbed) {\n",
       "      vegaEmbed(outputDiv, spec, embedOpt)\n",
       "        .catch(err => showError(`Javascript Error: ${err.message}<br>This usually means there's a typo in your chart specification. See the javascript console for the full traceback.`));\n",
       "    }\n",
       "\n",
       "    if(typeof define === \"function\" && define.amd) {\n",
       "      requirejs.config({paths});\n",
       "      require([\"vega-embed\"], displayChart, err => showError(`Error loading script: ${err.message}`));\n",
       "    } else if (typeof vegaEmbed === \"function\") {\n",
       "      displayChart(vegaEmbed);\n",
       "    } else {\n",
       "      loadScript(\"vega\")\n",
       "        .then(() => loadScript(\"vega-lite\"))\n",
       "        .then(() => loadScript(\"vega-embed\"))\n",
       "        .catch(showError)\n",
       "        .then(() => displayChart(vegaEmbed));\n",
       "    }\n",
       "  })({\"config\": {\"view\": {\"continuousWidth\": 400, \"continuousHeight\": 300}}, \"layer\": [{\"mark\": {\"type\": \"bar\", \"color\": \"#1EAFAE\", \"height\": 2}, \"encoding\": {\"x\": {\"type\": \"quantitative\", \"field\": \"y\"}, \"y\": {\"type\": \"nominal\", \"field\": \"x\"}}}, {\"mark\": {\"type\": \"circle\", \"color\": \"#ba5c25\", \"opacity\": 1}, \"encoding\": {\"x\": {\"type\": \"quantitative\", \"field\": \"y\"}, \"y\": {\"type\": \"nominal\", \"field\": \"x\"}}}], \"data\": {\"name\": \"data-edccf3e9c12863151aa952e49acf176b\"}, \"$schema\": \"https://vega.github.io/schema/vega-lite/v4.0.2.json\", \"datasets\": {\"data-edccf3e9c12863151aa952e49acf176b\": [{\"x\": \"c0\", \"y\": 3.9}, {\"x\": \"c1\", \"y\": 4.4}, {\"x\": \"c7\", \"y\": 9.9}, {\"x\": \"c3\", \"y\": 10.3}, {\"x\": \"c2\", \"y\": 10.8}, {\"x\": \"c4\", \"y\": 11.2}, {\"x\": \"c10\", \"y\": 12.5}, {\"x\": \"c5\", \"y\": 13.1}, {\"x\": \"c8\", \"y\": 13.9}, {\"x\": \"c6\", \"y\": 14.1}, {\"x\": \"c9\", \"y\": 15.1}]}}, {\"mode\": \"vega-lite\"});\n",
       "</script>"
      ],
      "text/plain": [
       "alt.LayerChart(...)"
      ]
     },
     "execution_count": 29,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "#排下序\n",
    "d3=d2.sort_values(by='y')\n",
    "bar= alt.Chart(d3).mark_bar(height=2,color='#1EAFAE').encode(x='y',y='x')\n",
    "bar + bar.mark_circle(color='#ba5c25',opacity=1)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 94,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "\n",
       "<div id=\"altair-viz-36a8322f07ca4415a975ff00f11b51b4\"></div>\n",
       "<script type=\"text/javascript\">\n",
       "  (function(spec, embedOpt){\n",
       "    const outputDiv = document.getElementById(\"altair-viz-36a8322f07ca4415a975ff00f11b51b4\");\n",
       "    const paths = {\n",
       "      \"vega\": \"https://cdn.jsdelivr.net/npm//vega@5?noext\",\n",
       "      \"vega-lib\": \"https://cdn.jsdelivr.net/npm//vega-lib?noext\",\n",
       "      \"vega-lite\": \"https://cdn.jsdelivr.net/npm//vega-lite@4.0.2?noext\",\n",
       "      \"vega-embed\": \"https://cdn.jsdelivr.net/npm//vega-embed@6?noext\",\n",
       "    };\n",
       "\n",
       "    function loadScript(lib) {\n",
       "      return new Promise(function(resolve, reject) {\n",
       "        var s = document.createElement('script');\n",
       "        s.src = paths[lib];\n",
       "        s.async = true;\n",
       "        s.onload = () => resolve(paths[lib]);\n",
       "        s.onerror = () => reject(`Error loading script: ${paths[lib]}`);\n",
       "        document.getElementsByTagName(\"head\")[0].appendChild(s);\n",
       "      });\n",
       "    }\n",
       "\n",
       "    function showError(err) {\n",
       "      outputDiv.innerHTML = `<div class=\"error\" style=\"color:red;\">${err}</div>`;\n",
       "      throw err;\n",
       "    }\n",
       "\n",
       "    function displayChart(vegaEmbed) {\n",
       "      vegaEmbed(outputDiv, spec, embedOpt)\n",
       "        .catch(err => showError(`Javascript Error: ${err.message}<br>This usually means there's a typo in your chart specification. See the javascript console for the full traceback.`));\n",
       "    }\n",
       "\n",
       "    if(typeof define === \"function\" && define.amd) {\n",
       "      requirejs.config({paths});\n",
       "      require([\"vega-embed\"], displayChart, err => showError(`Error loading script: ${err.message}`));\n",
       "    } else if (typeof vegaEmbed === \"function\") {\n",
       "      displayChart(vegaEmbed);\n",
       "    } else {\n",
       "      loadScript(\"vega\")\n",
       "        .then(() => loadScript(\"vega-lite\"))\n",
       "        .then(() => loadScript(\"vega-embed\"))\n",
       "        .catch(showError)\n",
       "        .then(() => displayChart(vegaEmbed));\n",
       "    }\n",
       "  })({\"config\": {\"view\": {\"height\": 300, \"width\": 400}, \"mark\": {\"color\": [\"#1eafae\", \"#69ffff\", \"#ba5c25\", \"#ffa069\", \"#a3ffff\", \"#d7ce88\"], \"fill\": [\"#1eafae\", \"#69ffff\", \"#ba5c25\", \"#ffa069\", \"#a3ffff\", \"#d7ce88\"]}}, \"layer\": [{\"mark\": {\"type\": \"bar\", \"color\": \"#1EAFAE\", \"height\": 2}, \"encoding\": {\"x\": {\"type\": \"quantitative\", \"field\": \"y\"}, \"y\": {\"type\": \"nominal\", \"field\": \"x\"}}}, {\"mark\": {\"type\": \"circle\", \"color\": \"#ba5c25\", \"opacity\": 1}, \"encoding\": {\"x\": {\"type\": \"quantitative\", \"field\": \"y\"}, \"y\": {\"type\": \"nominal\", \"field\": \"x\"}}}], \"data\": {\"name\": \"data-edccf3e9c12863151aa952e49acf176b\"}, \"$schema\": \"https://vega.github.io/schema/vega-lite/v4.0.2.json\", \"datasets\": {\"data-edccf3e9c12863151aa952e49acf176b\": [{\"x\": \"c0\", \"y\": 3.9}, {\"x\": \"c1\", \"y\": 4.4}, {\"x\": \"c7\", \"y\": 9.9}, {\"x\": \"c3\", \"y\": 10.3}, {\"x\": \"c2\", \"y\": 10.8}, {\"x\": \"c4\", \"y\": 11.2}, {\"x\": \"c10\", \"y\": 12.5}, {\"x\": \"c5\", \"y\": 13.1}, {\"x\": \"c8\", \"y\": 13.9}, {\"x\": \"c6\", \"y\": 14.1}, {\"x\": \"c9\", \"y\": 15.1}]}}, {\"mode\": \"vega-lite\"});\n",
       "</script>"
      ],
      "text/plain": [
       "alt.LayerChart(...)"
      ]
     },
     "execution_count": 94,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "#排下序\n",
    "d3=d2.sort_values(by='y')\n",
    "bar= alt.Chart(d3).mark_bar(height=2,color='#1EAFAE').encode(x='y',y='x')\n",
    "bar + bar.mark_circle(color='#ba5c25',opacity=1)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 31,
   "metadata": {},
   "outputs": [],
   "source": [
    "#bar2.save('chart.png') #保存为png，pdf等需要其他库辅助"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "#饼图"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 进一步深入主题"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "Scales, Axes, and Legends\n",
    "\n",
    "多张图，组合图的两种写法（参考xmind）\n",
    "\n",
    "图表的保存，变成hmtl"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "#自定主题"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 136,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "ThemeRegistry.enable('lyns_theme')"
      ]
     },
     "execution_count": 136,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "def lyns_marks():\n",
    "    return {\n",
    "        'config': {\n",
    "            'view': {\n",
    "                'height': 300,\n",
    "                'width': 400,\n",
    "            },\n",
    "            'mark': {\n",
    "                'color':'#1eafae',\n",
    "                #'fill':'#1eafae'\n",
    "            }\n",
    "        }\n",
    "    }\n",
    "alt.themes.register('lyns_theme',lyns_marks)\n",
    "\n",
    "alt.themes.enable('lyns_theme')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "#画地图\n",
    "world_topo = data.world_110m()\n",
    "alt.Chart(alt.topo_feature(world, 'countries')).mark_geoshape()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [],
   "source": [
    "alt.Chart(alt.topo_feature(world, 'countries')).mark_geoshape(\n",
    "    fill='#2a1d0c', stroke='#706545', strokeWidth=0.5\n",
    ").project(\n",
    "    type='mercator'\n",
    ").interactive()  #墨卡托投影"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "alt.Chart(zipcodes).mark_square(\n",
    "    size=1, opacity=1\n",
    ").encode(\n",
    "    longitude='longitude:Q', # apply the field named 'longitude' to the longitude channel\n",
    "    latitude='latitude:Q'    # apply the field named 'latitude' to the latitude channel\n",
    ").project(\n",
    "    type='albersUsa'\n",
    ").properties(\n",
    "    width=900,\n",
    "    height=500\n",
    ").configure_view(\n",
    "    stroke=None\n",
    ")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 参考资料\n",
    "\n",
    "- [官网](https://altair-viz.github.io/)\n",
    "- [notebook上的Altar教程](https://github.com/uwdata/visualization-curriculum)"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.0"
  },
  "toc": {
   "base_numbering": 1,
   "nav_menu": {},
   "number_sections": true,
   "sideBar": true,
   "skip_h1_title": false,
   "title_cell": "Table of Contents",
   "title_sidebar": "Contents",
   "toc_cell": false,
   "toc_position": {},
   "toc_section_display": true,
   "toc_window_display": false
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
